fluid-framework 2.10.0-307399 → 2.10.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 +148 -0
- package/api-report/fluid-framework.legacy.alpha.api.md +1 -0
- package/package.json +11 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,153 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.10.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Unsupported merge-tree types and related exposed internals have been removed ([#22696](https://github.com/microsoft/FluidFramework/pull/22696)) [7a032533a6](https://github.com/microsoft/FluidFramework/commit/7a032533a6ee6a6f76fe154ef65dfa33f87e5a7b)
|
|
8
|
+
|
|
9
|
+
As part of ongoing improvements, several internal types and related APIs have been removed. These types are unnecessary for any supported scenarios and could lead to errors if used. Since directly using these types would likely result in errors, these changes are not likely to impact any Fluid Framework consumers.
|
|
10
|
+
|
|
11
|
+
Removed types:
|
|
12
|
+
|
|
13
|
+
- IMergeTreeTextHelper
|
|
14
|
+
- MergeNode
|
|
15
|
+
- ObliterateInfo
|
|
16
|
+
- PropertiesManager
|
|
17
|
+
- PropertiesRollback
|
|
18
|
+
- SegmentGroup
|
|
19
|
+
- SegmentGroupCollection
|
|
20
|
+
|
|
21
|
+
In addition to removing the above types, they are no longer exposed through the following interfaces and their implementations: `ISegment`, `ReferencePosition`, and `ISerializableInterval`.
|
|
22
|
+
|
|
23
|
+
Removed functions:
|
|
24
|
+
|
|
25
|
+
- addProperties
|
|
26
|
+
- ack
|
|
27
|
+
|
|
28
|
+
Removed properties:
|
|
29
|
+
|
|
30
|
+
- propertyManager
|
|
31
|
+
- segmentGroups
|
|
32
|
+
|
|
33
|
+
The initial deprecations of the now changed or removed types were announced in Fluid Framework v2.2.0:
|
|
34
|
+
[Fluid Framework v2.2.0](https://github.com/microsoft/FluidFramework/blob/main/RELEASE_NOTES/2.2.0.md)
|
|
35
|
+
|
|
36
|
+
- Fix typing bug in `adaptEnum` and `enumFromStrings` ([#23077](https://github.com/microsoft/FluidFramework/pull/23077)) [cfb68388cb](https://github.com/microsoft/FluidFramework/commit/cfb68388cb6b88a0ef670633b3afa46a82c99972)
|
|
37
|
+
|
|
38
|
+
When using the return value from [`adaptEnum`](https://fluidframework.com/docs/api/v2/tree#adaptenum-function) as a function, passing in a value who's type is a union no longer produced an incorrectly typed return value. This has been fixed.
|
|
39
|
+
|
|
40
|
+
Additionally [`enumFromStrings`](https://fluidframework.com/docs/api/v2/tree#enumfromstrings-function) has improved the typing of its schema, ensuring the returned object's members have sufficiently specific types.
|
|
41
|
+
Part of this improvement was fixing the `.schema` property to be a tuple over each of the schema where it was previously a tuple of a single combined schema due to a bug.
|
|
42
|
+
|
|
43
|
+
One side-effect of these fixes is that narrowing of the `value` field of a node typed from the `.schema` behaves slightly different, such that the node type is now a union instead of it being a single type with a `.value` that is a union.
|
|
44
|
+
This means that narrowing based on `.value` property narrows which node type you have, not just the value property.
|
|
45
|
+
This mainly matters when matching all cases like the switch statement below:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
const Mode = enumFromStrings(schema, ["Fun", "Bonus"]);
|
|
49
|
+
type Mode = TreeNodeFromImplicitAllowedTypes<typeof Mode.schema>;
|
|
50
|
+
const node = new Mode.Bonus() as Mode;
|
|
51
|
+
|
|
52
|
+
switch (node.value) {
|
|
53
|
+
case "Fun": {
|
|
54
|
+
assert.fail();
|
|
55
|
+
}
|
|
56
|
+
case "Bonus": {
|
|
57
|
+
// This one runs
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
default:
|
|
61
|
+
// Before this change, "node.value" was never here, now "node" is never.
|
|
62
|
+
unreachableCase(node);
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- SharedTree event listeners that implement `Listenable` now allow deregistration of event listeners via an `off()` function. ([#23046](https://github.com/microsoft/FluidFramework/pull/23046)) [c59225db03](https://github.com/microsoft/FluidFramework/commit/c59225db033a516ee20e459ae31567d97ce8776c)
|
|
67
|
+
|
|
68
|
+
The ability to deregister events via a callback returned by `on()` remains the same.
|
|
69
|
+
Both strategies will remain supported and consumers of SharedTree events may choose which method of deregistration they prefer in a given instance.
|
|
70
|
+
|
|
71
|
+
```typescript
|
|
72
|
+
// The new behavior
|
|
73
|
+
function deregisterViaOff(view: TreeView<MySchema>): {
|
|
74
|
+
const listener = () => { /* ... */ };
|
|
75
|
+
view.events.on("commitApplied", listener); // Register
|
|
76
|
+
view.events.off("commitApplied", listener); // Deregister
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// The existing behavior (still supported)
|
|
80
|
+
function deregisterViaCallback(view: TreeView<MySchema>): {
|
|
81
|
+
const off = view.events.on("commitApplied", () => { /* ... */ }); // Register
|
|
82
|
+
off(); // Deregister
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
- Allow constructing recursive maps from objects ([#23070](https://github.com/microsoft/FluidFramework/pull/23070)) [0185a08c6f](https://github.com/microsoft/FluidFramework/commit/0185a08c6f8bf6e922a6467f11da049503c4d215)
|
|
87
|
+
|
|
88
|
+
Previously only non-recursive maps could be constructed from objects.
|
|
89
|
+
Now all maps nodes can constructed from objects:
|
|
90
|
+
|
|
91
|
+
```typescript
|
|
92
|
+
class MapRecursive extends sf.mapRecursive("Map", [() => MapRecursive]) {}
|
|
93
|
+
{
|
|
94
|
+
type _check = ValidateRecursiveSchema<typeof MapRecursive>;
|
|
95
|
+
}
|
|
96
|
+
// New:
|
|
97
|
+
const fromObject = new MapRecursive({ x: new MapRecursive() });
|
|
98
|
+
// Existing:
|
|
99
|
+
const fromIterator = new MapRecursive([["x", new MapRecursive()]]);
|
|
100
|
+
const fromMap = new MapRecursive(new Map([["x", new MapRecursive()]]));
|
|
101
|
+
const fromNothing = new MapRecursive();
|
|
102
|
+
const fromUndefined = new MapRecursive(undefined);
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
- SharedString DDS annotateAdjustRange ([#22751](https://github.com/microsoft/FluidFramework/pull/22751)) [d54b9dde14](https://github.com/microsoft/FluidFramework/commit/d54b9dde14e9e0e5eb7999db8ebf6da98fdfb526)
|
|
106
|
+
|
|
107
|
+
This update introduces a new feature to the `SharedString` DDS, allowing for the adjustment of properties over a specified range. The `annotateAdjustRange` method enables users to apply adjustments to properties within a given range, providing more flexibility and control over property modifications.
|
|
108
|
+
|
|
109
|
+
An adjustment is a modification applied to a property value within a specified range. Adjustments can be used to increment or decrement property values dynamically. They are particularly useful in scenarios where property values need to be updated based on user interactions or other events. For example, in a rich text editor, adjustments can be used for modifying indentation levels or font sizes, where multiple users could apply differing numerical adjustments.
|
|
110
|
+
|
|
111
|
+
### Key Features and Use Cases:
|
|
112
|
+
|
|
113
|
+
- **Adjustments with Constraints**: Adjustments can include optional minimum and maximum constraints to ensure the final value falls within specified bounds. This is particularly useful for maintaining consistent formatting in rich text editors.
|
|
114
|
+
- **Consistent Property Changes**: The feature ensures that property changes are consistent, managing both local and remote changes effectively. This is essential for collaborative rich text editing where multiple users may be making adjustments simultaneously.
|
|
115
|
+
- **Rich Text Formatting**: Adjustments can be used to modify text properties such as font size, indentation, or other formatting attributes dynamically based on user actions.
|
|
116
|
+
|
|
117
|
+
### Configuration and Compatibility Requirements:
|
|
118
|
+
|
|
119
|
+
This feature is only available when the configuration `Fluid.Sequence.mergeTreeEnableAnnotateAdjust` is set to `true`. Additionally, all collaborating clients must have this feature enabled to use it. If any client does not have this feature enabled, it will lead to the client exiting collaboration. A future major version of Fluid will enable this feature by default.
|
|
120
|
+
|
|
121
|
+
### Usage Example:
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
sharedString.annotateAdjustRange(start, end, {
|
|
125
|
+
key: { value: 5, min: 0, max: 10 },
|
|
126
|
+
});
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- MergeTree `Client` Legacy API Removed ([#22697](https://github.com/microsoft/FluidFramework/pull/22697)) [2aa0b5e794](https://github.com/microsoft/FluidFramework/commit/2aa0b5e7941efe52386782595f96ff847c786fc3)
|
|
130
|
+
|
|
131
|
+
The `Client` class in the merge-tree package has been removed. Types that directly or indirectly expose the merge-tree `Client` class have also been removed.
|
|
132
|
+
|
|
133
|
+
The removed types were not meant to be used directly, and direct usage was not supported:
|
|
134
|
+
|
|
135
|
+
- AttributionPolicy
|
|
136
|
+
- IClientEvents
|
|
137
|
+
- IMergeTreeAttributionOptions
|
|
138
|
+
- SharedSegmentSequence
|
|
139
|
+
- SharedStringClass
|
|
140
|
+
|
|
141
|
+
Some classes that referenced the `Client` class have been transitioned to interfaces. Direct instantiation of these classes was not supported or necessary for any supported scenario, so the change to an interface should not impact usage. This applies to the following types:
|
|
142
|
+
|
|
143
|
+
- SequenceInterval
|
|
144
|
+
- SequenceEvent
|
|
145
|
+
- SequenceDeltaEvent
|
|
146
|
+
- SequenceMaintenanceEvent
|
|
147
|
+
|
|
148
|
+
The initial deprecations of the now changed or removed types were announced in Fluid Framework v2.4.0:
|
|
149
|
+
[Several MergeTree Client Legacy APIs are now deprecated](https://github.com/microsoft/FluidFramework/blob/main/RELEASE_NOTES/2.4.0.md#several-mergetree-client-legacy-apis-are-now-deprecated-22629)
|
|
150
|
+
|
|
3
151
|
## 2.5.0
|
|
4
152
|
|
|
5
153
|
### Minor Changes
|
|
@@ -756,6 +756,7 @@ export interface ISharedObjectEvents extends IErrorEvent {
|
|
|
756
756
|
|
|
757
757
|
// @alpha (undocumented)
|
|
758
758
|
export interface ISharedSegmentSequence<T extends ISegment> extends ISharedObject<ISharedSegmentSequenceEvents>, ISharedIntervalCollection<SequenceInterval>, MergeTreeRevertibleDriver {
|
|
759
|
+
annotateAdjustRange(start: number, end: number, adjust: MapLike<AdjustParams>): void;
|
|
759
760
|
annotateRange(start: number, end: number, props: PropertySet): void;
|
|
760
761
|
createLocalReferencePosition(segment: T, offset: number, refType: ReferenceType, properties: PropertySet | undefined, slidingPreference?: SlidingPreference, canSlideToEndpoint?: boolean): LocalReferencePosition;
|
|
761
762
|
getContainingSegment(pos: number): {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-framework",
|
|
3
|
-
"version": "2.10.0
|
|
3
|
+
"version": "2.10.0",
|
|
4
4
|
"description": "The main entry point into Fluid Framework public packages",
|
|
5
5
|
"homepage": "https://fluidframework.com",
|
|
6
6
|
"repository": {
|
|
@@ -57,16 +57,16 @@
|
|
|
57
57
|
"main": "lib/index.js",
|
|
58
58
|
"types": "lib/public.d.ts",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@fluidframework/container-definitions": "2.10.0
|
|
61
|
-
"@fluidframework/container-loader": "2.10.0
|
|
62
|
-
"@fluidframework/core-interfaces": "2.10.0
|
|
63
|
-
"@fluidframework/driver-definitions": "2.10.0
|
|
64
|
-
"@fluidframework/fluid-static": "2.10.0
|
|
65
|
-
"@fluidframework/map": "2.10.0
|
|
66
|
-
"@fluidframework/runtime-utils": "2.10.0
|
|
67
|
-
"@fluidframework/sequence": "2.10.0
|
|
68
|
-
"@fluidframework/shared-object-base": "2.10.0
|
|
69
|
-
"@fluidframework/tree": "2.10.0
|
|
60
|
+
"@fluidframework/container-definitions": "~2.10.0",
|
|
61
|
+
"@fluidframework/container-loader": "~2.10.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~2.10.0",
|
|
63
|
+
"@fluidframework/driver-definitions": "~2.10.0",
|
|
64
|
+
"@fluidframework/fluid-static": "~2.10.0",
|
|
65
|
+
"@fluidframework/map": "~2.10.0",
|
|
66
|
+
"@fluidframework/runtime-utils": "~2.10.0",
|
|
67
|
+
"@fluidframework/sequence": "~2.10.0",
|
|
68
|
+
"@fluidframework/shared-object-base": "~2.10.0",
|
|
69
|
+
"@fluidframework/tree": "~2.10.0"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@arethetypeswrong/cli": "^0.16.4",
|