fluid-framework 2.63.0-359734 → 2.63.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 CHANGED
@@ -1,5 +1,86 @@
1
1
  # fluid-framework
2
2
 
3
+ ## 2.63.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Stabilize allowUnknownOptionalFields to beta [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
8
+
9
+ When constructing object node schema with `SchemaFactoryBeta.object` or `SchemaFactoryBeta.objectRecursive` you can now provide the `allowUnknownOptionalFields` option as well as other `metadata` which were previously only available in `SchemaFactoryAlpha.objectAlpha` and `SchemaFactoryAlpha.objectRecursive`.
10
+
11
+ Additionally the alpha interface `SchemaFactoryObjectOptions` has been renamed to `ObjectSchemaOptionsAlpha` to better align with the other related types.
12
+
13
+ - Alpha APIs for annotated allowed types have been refactored [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
14
+
15
+ Staged allowed types must now be run through `SchemaFactoryAlpha.types` to convert them into an [`AllowedTypes`](https://fluidframework.com/docs/api/tree/allowedtypes-typealias).
16
+ This change also means that it is now possible to use the produced `AllowedTypesFull` in non-alpha APIs since it implements `AllowedTypes`.
17
+
18
+ Reading data out of `ImplicitAllowedTypes` should now be done via `normalizeAllowedTypes` which now returns a `AllowedTypesFull` providing access to all the data in a friendly format.
19
+
20
+ - Add TreeBeta.create [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
21
+
22
+ Adds `TreeBeta.create`, which is a more stable version of the existing [`TreeAlpha.create`](https://fluidframework.com/docs/api/tree/treealpha-interface#create-methodsignature).
23
+ The only difference is the new `TreeBeta.create` does not support the `@alpha` [`UnsafeUnknownSchema`](https://fluidframework.com/docs/api/tree/unsafeunknownschema-typealias) option.
24
+
25
+ - Add SchemaFactoryAlpha.typesRecursive and SchemaFactoryAlpha.stagedRecursive [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
26
+
27
+ With these new APIs, it is now possible to [`stage`](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class#staged-property) changes to recursive types.
28
+
29
+ - Add FluidSerializableAsTree domain for representing trees of serializable data (alpha) [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
30
+
31
+ Like [JsonAsTree](https://fluidframework.com/docs/api/tree/jsonastree-namespace/), but also supports [Fluid Handles](https://fluidframework.com/docs/concepts/handles).
32
+
33
+ - Promote Record node types and factories to beta [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
34
+
35
+ Record tree node schema may now be declared using [SchemaFactoryBeta](https://fluidframework.com/docs/api/tree/schemafactorybeta-class) in addition to [SchemaFactoryAlpha](https://fluidframework.com/docs/api/tree/schemafactoryalpha-class).
36
+
37
+ - Promote importConcise and exportConcise to beta [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
38
+
39
+ `importConcise` and `exportConcise` were previously available via [TreeAlpha](https://fluidframework.com/docs/api/tree/treealpha-interface).
40
+ They may now also be accessed via [TreeBeta](https://fluidframework.com/docs/api/tree/treebeta-interface).
41
+
42
+ Note that the beta form of `importConcise` does not support [UnsafeUnknownSchema](https://fluidframework.com/docs/api/fluid-framework/unsafeunknownschema-typealias).
43
+
44
+ - MinimumVersionForCollab is now used in place of tree's alpha FluidClientVersion [9b89d8f90f8](https://github.com/microsoft/FluidFramework/commit/9b89d8f90f8a4533d3cda786189421f48d6d4bab)
45
+
46
+ `FluidClientVersion`: No longer used as the type for Fluid Client versions in APIs/codecs (for example, `oldestCompatibleClient`).
47
+ Additionally, `FluidClientVersion` is now a const object with members that declare specific [`MinimumVersionForCollab`](https://fluidframework.com/docs/api/runtime-definitions/minimumversionforcollab-typealias) versions.
48
+ These are intended to be used with APIs that require a version (such as `TreeAlpha.exportCompressed`).
49
+
50
+ `CodecWriteOptions` and `SharedTreeOptions`: `oldestCompatibleClient` has been replaced by `minVersionForCollab`.
51
+ See migration guide below.
52
+
53
+ `TreeAlpha.exportCompressed`: The `options` parameter previously had `oldestCompatibleClient` and now has `minVersionForCollab`.
54
+ Migrating requires a rename. Existing `FluidClientVersion.*` values are now `MinimumClientVersion`s.
55
+
56
+ #### Migrating
57
+
58
+ If an application is calling `loadContainerRuntime` directly and previously specified the minimum client version when
59
+ initializing Shared Tree like:
60
+
61
+ ```ts
62
+ const factory = configuredSharedTree({ ..., oldestCompatibleClient: FluidClientVersion.v2_52 });
63
+ ```
64
+
65
+ Then the new implementation depends on how the application initializes Fluid.
66
+
67
+ ##### Applications using `AzureClient`/`OdspClient`
68
+
69
+ If an application is using the declarative model (for example, `AzureClient`/`OdspClient`), it should continue to call `configuredSharedTree`
70
+ but specify `minVersionForCollab` instead:
71
+
72
+ ```ts
73
+ const factory = configuredSharedTree({ ..., minVersionForCollab: "2.52.0" });
74
+ ```
75
+
76
+ ##### Applications calling `loadContainerRuntime`
77
+
78
+ If an application is initializing the `ContainerRuntime` directly, it should now specify the `minVersionForCollab` there:
79
+
80
+ ```ts
81
+ const runtime = await loadContainerRuntime({ ..., minVersionForCollab: "2.52.0" });
82
+ ```
83
+
3
84
  ## 2.62.0
4
85
 
5
86
  ### Minor Changes
@@ -33,6 +33,12 @@ export type AllowedTypesFullEvaluated = AllowedTypesFull<readonly AnnotatedAllow
33
33
  // @alpha @sealed
34
34
  export type AllowedTypesFullFromMixed<T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]> = UnannotateAllowedTypesList<T> & AnnotatedAllowedTypes<AnnotateAllowedTypesList<T>>;
35
35
 
36
+ // @alpha @sealed @system
37
+ export type AllowedTypesFullFromMixedUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = UnannotateAllowedTypesListUnsafe<T> & AnnotatedAllowedTypes<AnnotateAllowedTypesListUnsafe<T>>;
38
+
39
+ // @alpha @sealed @system
40
+ export type AllowedTypesFullUnsafe<T extends readonly AnnotatedAllowedTypeUnsafe[] = readonly AnnotatedAllowedTypeUnsafe[]> = AnnotatedAllowedTypes<T> & UnannotateAllowedTypesListUnsafe<T>;
41
+
36
42
  // @alpha @input
37
43
  export interface AllowedTypesMetadata {
38
44
  readonly custom?: unknown;
@@ -46,6 +52,11 @@ export type AnnotateAllowedTypesList<T extends readonly (AnnotatedAllowedType |
46
52
  [I in keyof T]: T[I] extends AnnotatedAllowedType<unknown> ? T[I] : AnnotatedAllowedType<T[I]>;
47
53
  };
48
54
 
55
+ // @alpha @sealed @system
56
+ export type AnnotateAllowedTypesListUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = {
57
+ [I in keyof T]: T[I] extends AnnotatedAllowedTypeUnsafe ? T[I] : AnnotatedAllowedTypeUnsafe<T[I]>;
58
+ };
59
+
49
60
  // @alpha @sealed
50
61
  export interface AnnotatedAllowedType<T = LazyItem<TreeNodeSchema>> {
51
62
  readonly metadata: AllowedTypeMetadata;
@@ -61,6 +72,14 @@ export interface AnnotatedAllowedTypes<T = readonly AnnotatedAllowedType[]> exte
61
72
  readonly types: T;
62
73
  }
63
74
 
75
+ // @alpha @sealed @system
76
+ export interface AnnotatedAllowedTypesUnsafe extends AnnotatedAllowedTypes<LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>> {
77
+ }
78
+
79
+ // @alpha @sealed @system
80
+ export interface AnnotatedAllowedTypeUnsafe<T = Unenforced<LazyItem<TreeNodeSchema>>> extends AnnotatedAllowedType<T> {
81
+ }
82
+
64
83
  // @public @system
65
84
  type ApplyKind<T, Kind extends FieldKind> = {
66
85
  [FieldKind.Required]: T;
@@ -124,7 +143,7 @@ export function cloneWithReplacements(root: unknown, rootKey: string, replacer:
124
143
 
125
144
  // @alpha @input
126
145
  export interface CodecWriteOptions extends ICodecOptions {
127
- readonly oldestCompatibleClient: FluidClientVersion;
146
+ readonly minVersionForCollab: MinimumVersionForCollab;
128
147
  }
129
148
 
130
149
  // @public
@@ -246,7 +265,7 @@ export function evaluateLazySchema<T extends TreeNodeSchema>(value: LazyItem<T>)
246
265
  type ExtractItemType<Item extends LazyItem> = Item extends () => infer Result ? Result : Item;
247
266
 
248
267
  // @alpha
249
- export function extractPersistedSchema(schema: ImplicitFieldSchema, oldestCompatibleClient: FluidClientVersion, includeStaged: (upgrade: SchemaUpgrade) => boolean): JsonCompatible;
268
+ export function extractPersistedSchema(schema: ImplicitFieldSchema, minVersionForCollab: MinimumVersionForCollab, includeStaged: (upgrade: SchemaUpgrade) => boolean): JsonCompatible;
250
269
 
251
270
  // @alpha @system
252
271
  export type FactoryContent = IFluidHandle | string | number | boolean | null | Iterable<readonly [string, InsertableContent]> | readonly InsertableContent[] | FactoryContentObject;
@@ -331,11 +350,10 @@ type FlexList<Item = unknown> = readonly LazyItem<Item>[];
331
350
  type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
332
351
 
333
352
  // @alpha
334
- export enum FluidClientVersion {
335
- EnableUnstableFeatures,
336
- v2_0 = 2,
337
- v2_52 = 2.052
338
- }
353
+ export const FluidClientVersion: {
354
+ readonly v2_0: "2.0.0";
355
+ readonly v2_52: "2.52.0";
356
+ };
339
357
 
340
358
  // @public
341
359
  export type FluidObject<T = unknown> = {
@@ -1266,8 +1284,12 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
1266
1284
  scopedFactoryAlpha<const T extends TName, TNameInner extends number | string = string>(name: T): SchemaFactoryAlpha<ScopedSchemaName<TScope, T>, TNameInner>;
1267
1285
  static staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
1268
1286
  staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
1287
+ static stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1288
+ stagedRecursive: <const T extends unknown>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1269
1289
  static types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
1270
1290
  types: <const T extends readonly (LazyItem<TreeNodeSchema> | AnnotatedAllowedType<LazyItem<TreeNodeSchema>>)[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixed<T>;
1291
+ static typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
1292
+ typesRecursive: <const T extends readonly unknown[]>(t: T, metadata?: AllowedTypesMetadata | undefined) => AllowedTypesFullFromMixedUnsafe<T>;
1271
1293
  }
1272
1294
 
1273
1295
  // @beta
@@ -1306,7 +1328,9 @@ export interface SchemaStatics {
1306
1328
  // @alpha @sealed @system
1307
1329
  export interface SchemaStaticsAlpha {
1308
1330
  readonly staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
1331
+ stagedRecursive: <const T extends Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>>(t: T) => AnnotatedAllowedTypeUnsafe<UnannotateAllowedTypeUnsafe<T>>;
1309
1332
  readonly types: <const T extends readonly (AnnotatedAllowedType | LazyItem<TreeNodeSchema>)[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixed<T>;
1333
+ readonly typesRecursive: <const T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]>(t: T, metadata?: AllowedTypesMetadata) => AllowedTypesFullFromMixedUnsafe<T>;
1310
1334
  }
1311
1335
 
1312
1336
  // @alpha @sealed
@@ -1714,7 +1738,7 @@ export interface TreeAlpha {
1714
1738
  create<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
1715
1739
  exportCompressed(tree: TreeNode | TreeLeafValue, options: {
1716
1740
  idCompressor?: IIdCompressor;
1717
- } & Pick<CodecWriteOptions, "oldestCompatibleClient">): JsonCompatible<IFluidHandle>;
1741
+ } & Pick<CodecWriteOptions, "minVersionForCollab">): JsonCompatible<IFluidHandle>;
1718
1742
  exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
1719
1743
  exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: TreeEncodingOptions): ConciseTree | undefined;
1720
1744
  exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;
@@ -2007,6 +2031,16 @@ export type UnannotateAllowedTypesList<T extends readonly (AnnotatedAllowedType
2007
2031
  [I in keyof T]: T[I] extends AnnotatedAllowedType<infer X> ? X : T[I];
2008
2032
  };
2009
2033
 
2034
+ // @alpha @sealed @system
2035
+ export type UnannotateAllowedTypesListUnsafe<T extends readonly Unenforced<AnnotatedAllowedType | LazyItem<TreeNodeSchema>>[]> = {
2036
+ readonly [I in keyof T]: T[I] extends {
2037
+ type: infer X;
2038
+ } ? X : T[I];
2039
+ };
2040
+
2041
+ // @alpha @sealed @system
2042
+ export type UnannotateAllowedTypeUnsafe<T extends Unenforced<AnnotatedAllowedTypeUnsafe | LazyItem<System_Unsafe.TreeNodeSchemaUnsafe>>> = T extends AnnotatedAllowedTypeUnsafe<infer X> ? X : T;
2043
+
2010
2044
  // @public
2011
2045
  export type Unenforced<_DesiredExtendsConstraint> = unknown;
2012
2046
 
package/dist/alpha.d.ts CHANGED
@@ -167,10 +167,15 @@ export {
167
167
  AllowedTypesFull,
168
168
  AllowedTypesFullEvaluated,
169
169
  AllowedTypesFullFromMixed,
170
+ AllowedTypesFullFromMixedUnsafe,
171
+ AllowedTypesFullUnsafe,
170
172
  AllowedTypesMetadata,
171
173
  AnnotateAllowedTypesList,
174
+ AnnotateAllowedTypesListUnsafe,
172
175
  AnnotatedAllowedType,
176
+ AnnotatedAllowedTypeUnsafe,
173
177
  AnnotatedAllowedTypes,
178
+ AnnotatedAllowedTypesUnsafe,
174
179
  ArrayNodeCustomizableSchema,
175
180
  ArrayNodeCustomizableSchemaUnsafe,
176
181
  ArrayNodePojoEmulationSchema,
@@ -272,7 +277,9 @@ export {
272
277
  TreeSchemaEncodingOptions,
273
278
  TreeViewAlpha,
274
279
  TreeViewConfigurationAlpha,
280
+ UnannotateAllowedTypeUnsafe,
275
281
  UnannotateAllowedTypesList,
282
+ UnannotateAllowedTypesListUnsafe,
276
283
  UnsafeUnknownSchema,
277
284
  ValueSchema,
278
285
  VerboseTree,
package/lib/alpha.d.ts CHANGED
@@ -167,10 +167,15 @@ export {
167
167
  AllowedTypesFull,
168
168
  AllowedTypesFullEvaluated,
169
169
  AllowedTypesFullFromMixed,
170
+ AllowedTypesFullFromMixedUnsafe,
171
+ AllowedTypesFullUnsafe,
170
172
  AllowedTypesMetadata,
171
173
  AnnotateAllowedTypesList,
174
+ AnnotateAllowedTypesListUnsafe,
172
175
  AnnotatedAllowedType,
176
+ AnnotatedAllowedTypeUnsafe,
173
177
  AnnotatedAllowedTypes,
178
+ AnnotatedAllowedTypesUnsafe,
174
179
  ArrayNodeCustomizableSchema,
175
180
  ArrayNodeCustomizableSchemaUnsafe,
176
181
  ArrayNodePojoEmulationSchema,
@@ -272,7 +277,9 @@ export {
272
277
  TreeSchemaEncodingOptions,
273
278
  TreeViewAlpha,
274
279
  TreeViewConfigurationAlpha,
280
+ UnannotateAllowedTypeUnsafe,
275
281
  UnannotateAllowedTypesList,
282
+ UnannotateAllowedTypesListUnsafe,
276
283
  UnsafeUnknownSchema,
277
284
  ValueSchema,
278
285
  VerboseTree,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-framework",
3
- "version": "2.63.0-359734",
3
+ "version": "2.63.0",
4
4
  "description": "The main entry point into Fluid Framework public packages",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,17 +57,17 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/container-definitions": "2.63.0-359734",
61
- "@fluidframework/container-loader": "2.63.0-359734",
62
- "@fluidframework/core-interfaces": "2.63.0-359734",
63
- "@fluidframework/core-utils": "2.63.0-359734",
64
- "@fluidframework/driver-definitions": "2.63.0-359734",
65
- "@fluidframework/fluid-static": "2.63.0-359734",
66
- "@fluidframework/map": "2.63.0-359734",
67
- "@fluidframework/runtime-utils": "2.63.0-359734",
68
- "@fluidframework/sequence": "2.63.0-359734",
69
- "@fluidframework/shared-object-base": "2.63.0-359734",
70
- "@fluidframework/tree": "2.63.0-359734"
60
+ "@fluidframework/container-definitions": "~2.63.0",
61
+ "@fluidframework/container-loader": "~2.63.0",
62
+ "@fluidframework/core-interfaces": "~2.63.0",
63
+ "@fluidframework/core-utils": "~2.63.0",
64
+ "@fluidframework/driver-definitions": "~2.63.0",
65
+ "@fluidframework/fluid-static": "~2.63.0",
66
+ "@fluidframework/map": "~2.63.0",
67
+ "@fluidframework/runtime-utils": "~2.63.0",
68
+ "@fluidframework/sequence": "~2.63.0",
69
+ "@fluidframework/shared-object-base": "~2.63.0",
70
+ "@fluidframework/tree": "~2.63.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@arethetypeswrong/cli": "^0.17.1",