fluid-framework 2.51.0-347100 → 2.52.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,97 @@
1
1
  # fluid-framework
2
2
 
3
+ ## 2.52.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Change and clarify limitations related to alpha features allowUnknownOptionalFields and importVerbose ([#25074](https://github.com/microsoft/FluidFramework/pull/25074)) [62dc0b0095](https://github.com/microsoft/FluidFramework/commit/62dc0b0095226ade66648f6fd6b4f13b8c7880d8)
8
+
9
+ [allowUnknownOptionalFields](https://fluidframework.com/docs/api/fluid-framework/schemafactoryobjectoptions-interface#allowunknownoptionalfields-propertysignature) currently has some limitations.
10
+ To mitigate some bugs, [importVerbose](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#importverbose-methodsignature) has dropped support for unknown optional fields.
11
+ Previously `importVerbose` would tolerate some unknown optional fields, but could not validate they comply with the document stored schema.
12
+ This could cause some crashes, and likely document corruption.
13
+ This support has been removed: now trying to create nodes containing unknown optional fields via `importVerbose` will throw a `UsageError`.
14
+ There is no longer a way to create and insert nodes which contain subtrees for which there is no schema.
15
+
16
+ Ideally `exportVerbose` and `importVerbose` could be used to round trip data while optionally preserving unknown optional fields, but this is currently not working and thus not supported.
17
+
18
+ If exporting using [useStoredKeys](https://fluidframework.com/docs/api/fluid-framework/treeencodingoptions-interface#usestoredkeys-propertysignature), the unknown optional fields will be preserved but may not be able to be imported.
19
+ If exporting not using `useStoredKeys`, unknown optional fields will be omitted.
20
+
21
+ - Support unknown optional fields in TreeBeta.clone, TreeAlpha.exportConcise and TreeAlpha.exportVerbose ([#25106](https://github.com/microsoft/FluidFramework/pull/25106)) [e3a126ffac](https://github.com/microsoft/FluidFramework/commit/e3a126ffac46bb91e8b553535410d5532b05e662)
22
+
23
+ Trees with [unknown optional fields](https://fluidframework.com/docs/api/fluid-framework/schemafactoryobjectoptions-interface#allowunknownoptionalfields-propertysignature) are now supported in [TreeBeta.clone](https://fluidframework.com/docs/api/tree/treebeta-interface#clone-methodsignature), [TreeBeta.exportConcise](https://fluidframework.com/docs/api/tree/treealpha-interface#exportconcise-methodsignature) and [TreeBeta.exportVerbose](https://fluidframework.com/docs/api/tree/treealpha-interface#exportverbose-methodsignature).
24
+
25
+ Previously, attempts to clone or export such nodes could error in some cases, but should now work robustly.
26
+
27
+ - Fix independentInitializedView when used with ForestTypeExpensiveDebug ([#25083](https://github.com/microsoft/FluidFramework/pull/25083)) [2570b650b6](https://github.com/microsoft/FluidFramework/commit/2570b650b64f261fdf8cbfbfddaf3174577a5da2)
28
+
29
+ Previously, when using [independentInitializedView](https://fluidframework.com/docs/api/tree/#independentinitializedview-function) with [ForestTypeExpensiveDebug](https://fluidframework.com/docs/api/tree/#foresttypeexpensivedebug-variable) and the root schema was not an optional field, an error was thrown about the tree being out of schema.
30
+ This has been fixed.
31
+
32
+ - Allow attaching a SharedTree to an already attached container ([#25102](https://github.com/microsoft/FluidFramework/pull/25102)) [3e03f94f0e](https://github.com/microsoft/FluidFramework/commit/3e03f94f0e3529094304e272df75dae4bf43618e)
33
+
34
+ Before this release, attaching a SharedTree instance to an already attached container would fail with assert code `0x88f` if that instance needed to include data about removed nodes in its attach summary.
35
+ (This is the case when nodes are removed before attaching and there is a local branch that forks from a commit that made such a removal or from an earlier commit. This is also the case when retaining `Revertible` objects for those commits).
36
+
37
+ After this release, the behavior depends on the `CodecWriteOptions.oldestCompatibleClient` value:
38
+
39
+ - For values < `FluidClientVersion.v2_52`, the behavior is the same.
40
+ - For values >= `FluidClientVersion.v2_52`, the attach will succeed, but use a newer storage format.
41
+
42
+ Applications should take care to saturate their clients with FF version `2.52` (or greater) before using a `CodecWriteOptions.oldestCompatibleClient` that is equal to or greater than `FluidClientVersion.v2_52`.
43
+ Failure to do so may lead clients with `CodecWriteOptions.oldestCompatibleClient` equal to or greater than `FluidClientVersion.v2_52` to attach SharedTree instances using a storage format that is not supported by FF versions before `2.52`.
44
+ This means that application versions using FF versions before `2.52` will be unable to open documents where such an operation has happened.
45
+
46
+ ## 2.51.0
47
+
48
+ ### Minor Changes
49
+
50
+ - Fix adaptEnum's handling of numeric enums ([#24957](https://github.com/microsoft/FluidFramework/pull/24957)) [7535d31fa61](https://github.com/microsoft/FluidFramework/commit/7535d31fa61a535bf58bb88fc597e6e4f64c5b23)
51
+
52
+ Enum entries whose values are numeric get additional properties on TypeScript's generated Enum object.
53
+ These values were getting treated like enum entries at runtime by `adaptEnum` (`@beta`).
54
+ This has been fixed and the runtime behavior now matches the types in this case.
55
+
56
+ If any documents were created with this API which were impacted by this bug and keeping them openable is required, they will need a workaround.
57
+ Impacted schema using the union from `adaptEnum` can need to be updated to explicitly include the previously erroneously generated schema.
58
+
59
+ Before:
60
+
61
+ ```typescript
62
+ enum Mode {
63
+ a = 1,
64
+ }
65
+ const ModeNodes = adaptEnum(schemaFactory, Mode);
66
+ const union = ModeNodes.schema;
67
+ ```
68
+
69
+ After:
70
+
71
+ ```typescript
72
+ enum Mode {
73
+ a = 1,
74
+ }
75
+ const ModeNodes = adaptEnum(schemaFactory, Mode);
76
+ // Bugged version of adaptEnum used to include this: it should not be used but must be included in the schema for legacy document compatibility.
77
+ class Workaround extends schemaFactory.object("a", {}) {}
78
+ const union = [...ModeNodes.schema, Workaround] as const;
79
+ ```
80
+
81
+ To help detect when schema contain unexpected content, and to ensure workarounds like this are implemented properly, applications should include tests which check the schema for compatibility.
82
+ See [tree-cli-app's schema tests](https://github.com/microsoft/FluidFramework/blob/main/examples/apps/tree-cli-app/src/test/schema.spec.ts) for an example of how to do this.
83
+
84
+ The schema returned by `adaptEnum` have also been updated to `toString` to include the value of the particular enum entry: this has no effect on the nodes, just the schema.
85
+
86
+ - Make POJO mode TreeArrayNodes report the array constructor as their constructor ([#24988](https://github.com/microsoft/FluidFramework/pull/24988)) [7b4d0abe90f](https://github.com/microsoft/FluidFramework/commit/7b4d0abe90f50075bb06ef73ceceff2529ef78f5)
87
+
88
+ Make POJO mode TreeArrayNode's inherited `constructor` property report `Array` instead of the `TreeNodeSchema` class.
89
+ This is necessary to make `TreeArrayNode`s appear equal to arrays according to NodeJS's `assert.strict.deepEqual` in NodeJS 22.
90
+
91
+ - "rootChanged" event is no longer skipped if first change is setting the root to undefined ([#24994](https://github.com/microsoft/FluidFramework/pull/24994)) [e6f25875794](https://github.com/microsoft/FluidFramework/commit/e6f258757947b72b6a9d19c79f5717eccd44452b)
92
+
93
+ A bug has been fixed where [rootChanged](https://fluidframework.com/docs/api/fluid-framework/treeviewevents-interface#rootchanged-methodsignature) would not be fired if the change is the first change since the [TreeView](https://fluidframework.com/docs/api/fluid-framework/treeview-interface) became in-schema, and the change was setting the document root to `undefined`.
94
+
3
95
  ## 2.50.0
4
96
 
5
97
  ### Minor Changes
@@ -140,10 +140,14 @@ export enum ConnectionState {
140
140
 
141
141
  // @public
142
142
  export namespace ConnectionStateType {
143
- export type CatchingUp = 1;
144
- export type Connected = 2;
145
- export type Disconnected = 0;
146
- export type EstablishingConnection = 3;
143
+ const Disconnected = 0;
144
+ export type CatchingUp = typeof CatchingUp;
145
+ const EstablishingConnection = 3;
146
+ export type Connected = typeof Connected;
147
+ const CatchingUp = 1;
148
+ export type Disconnected = typeof Disconnected;
149
+ const Connected = 2;
150
+ export type EstablishingConnection = typeof EstablishingConnection;
147
151
  }
148
152
 
149
153
  // @public
@@ -290,7 +294,8 @@ type FlexListToUnion<TList extends FlexList> = ExtractItemType<TList[number]>;
290
294
  // @alpha
291
295
  export enum FluidClientVersion {
292
296
  EnableUnstableFeatures,
293
- v2_0 = 2
297
+ v2_0 = 2,
298
+ v2_52 = 2.052
294
299
  }
295
300
 
296
301
  // @public
@@ -1928,7 +1933,7 @@ const typeNameSymbol: unique symbol;
1928
1933
  export const typeSchemaSymbol: unique symbol;
1929
1934
 
1930
1935
  // @alpha @system
1931
- export type UnannotateAllowedType<T extends AnnotatedAllowedType> = T extends AnnotatedAllowedType<infer X> ? [X] : T;
1936
+ export type UnannotateAllowedType<T extends AnnotatedAllowedType | LazyItem<TreeNodeSchema>> = T extends AnnotatedAllowedType<infer X> ? [X] : T;
1932
1937
 
1933
1938
  // @alpha @system
1934
1939
  export type UnannotateAllowedTypeOrLazyItem<T extends AnnotatedAllowedType | LazyItem<TreeNodeSchema>> = T extends AnnotatedAllowedType<infer X> ? X : T;
@@ -60,10 +60,14 @@ export enum ConnectionState {
60
60
 
61
61
  // @public
62
62
  export namespace ConnectionStateType {
63
- export type CatchingUp = 1;
64
- export type Connected = 2;
65
- export type Disconnected = 0;
66
- export type EstablishingConnection = 3;
63
+ const Disconnected = 0;
64
+ export type CatchingUp = typeof CatchingUp;
65
+ const EstablishingConnection = 3;
66
+ export type Connected = typeof Connected;
67
+ const CatchingUp = 1;
68
+ export type Disconnected = typeof Disconnected;
69
+ const Connected = 2;
70
+ export type EstablishingConnection = typeof EstablishingConnection;
67
71
  }
68
72
 
69
73
  // @public
@@ -49,10 +49,14 @@ export enum ConnectionState {
49
49
 
50
50
  // @public
51
51
  export namespace ConnectionStateType {
52
- export type CatchingUp = 1;
53
- export type Connected = 2;
54
- export type Disconnected = 0;
55
- export type EstablishingConnection = 3;
52
+ const Disconnected = 0;
53
+ export type CatchingUp = typeof CatchingUp;
54
+ const EstablishingConnection = 3;
55
+ export type Connected = typeof Connected;
56
+ const CatchingUp = 1;
57
+ export type Disconnected = typeof Disconnected;
58
+ const Connected = 2;
59
+ export type EstablishingConnection = typeof EstablishingConnection;
56
60
  }
57
61
 
58
62
  // @public
@@ -49,10 +49,14 @@ export enum ConnectionState {
49
49
 
50
50
  // @public
51
51
  export namespace ConnectionStateType {
52
- export type CatchingUp = 1;
53
- export type Connected = 2;
54
- export type Disconnected = 0;
55
- export type EstablishingConnection = 3;
52
+ const Disconnected = 0;
53
+ export type CatchingUp = typeof CatchingUp;
54
+ const EstablishingConnection = 3;
55
+ export type Connected = typeof Connected;
56
+ const CatchingUp = 1;
57
+ export type Disconnected = typeof Disconnected;
58
+ const Connected = 2;
59
+ export type EstablishingConnection = typeof EstablishingConnection;
56
60
  }
57
61
 
58
62
  // @public
@@ -49,10 +49,14 @@ export enum ConnectionState {
49
49
 
50
50
  // @public
51
51
  export namespace ConnectionStateType {
52
- export type CatchingUp = 1;
53
- export type Connected = 2;
54
- export type Disconnected = 0;
55
- export type EstablishingConnection = 3;
52
+ const Disconnected = 0;
53
+ export type CatchingUp = typeof CatchingUp;
54
+ const EstablishingConnection = 3;
55
+ export type Connected = typeof Connected;
56
+ const CatchingUp = 1;
57
+ export type Disconnected = typeof Disconnected;
58
+ const Connected = 2;
59
+ export type EstablishingConnection = typeof EstablishingConnection;
56
60
  }
57
61
 
58
62
  // @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-framework",
3
- "version": "2.51.0-347100",
3
+ "version": "2.52.0",
4
4
  "description": "The main entry point into Fluid Framework public packages",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,24 +57,24 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/container-definitions": "2.51.0-347100",
61
- "@fluidframework/container-loader": "2.51.0-347100",
62
- "@fluidframework/core-interfaces": "2.51.0-347100",
63
- "@fluidframework/core-utils": "2.51.0-347100",
64
- "@fluidframework/driver-definitions": "2.51.0-347100",
65
- "@fluidframework/fluid-static": "2.51.0-347100",
66
- "@fluidframework/map": "2.51.0-347100",
67
- "@fluidframework/runtime-utils": "2.51.0-347100",
68
- "@fluidframework/sequence": "2.51.0-347100",
69
- "@fluidframework/shared-object-base": "2.51.0-347100",
70
- "@fluidframework/tree": "2.51.0-347100"
60
+ "@fluidframework/container-definitions": "~2.52.0",
61
+ "@fluidframework/container-loader": "~2.52.0",
62
+ "@fluidframework/core-interfaces": "~2.52.0",
63
+ "@fluidframework/core-utils": "~2.52.0",
64
+ "@fluidframework/driver-definitions": "~2.52.0",
65
+ "@fluidframework/fluid-static": "~2.52.0",
66
+ "@fluidframework/map": "~2.52.0",
67
+ "@fluidframework/runtime-utils": "~2.52.0",
68
+ "@fluidframework/sequence": "~2.52.0",
69
+ "@fluidframework/shared-object-base": "~2.52.0",
70
+ "@fluidframework/tree": "~2.52.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@arethetypeswrong/cli": "^0.17.1",
74
74
  "@biomejs/biome": "~1.9.3",
75
- "@fluid-tools/build-cli": "^0.56.0",
75
+ "@fluid-tools/build-cli": "^0.57.0",
76
76
  "@fluidframework/build-common": "^2.0.3",
77
- "@fluidframework/build-tools": "^0.56.0",
77
+ "@fluidframework/build-tools": "^0.57.0",
78
78
  "@fluidframework/eslint-config-fluid": "^5.7.4",
79
79
  "@microsoft/api-extractor": "7.52.8",
80
80
  "@types/node": "^18.19.0",