Contents
- ✨ New Features
- 🌳 SharedTree DDS Changes
- Provide more comprehensive replacement to the
commitApplied
event (#22977) - SharedTree event listeners that implement
Listenable
now allow deregistration of event listeners via anoff()
function. (#23046) - Allow constructing recursive maps from objects (#23070)
- Fix typing bug in
adaptEnum
andenumFromStrings
(#23077)
- Provide more comprehensive replacement to the
⚠️ Deprecations- Legacy API Changes
- Other Changes
✨ New Features
New compareFluidHandle function for comparing FluidHandles (#22997)
The new compareFluidHandle
function has been added to allow comparing handles without having to inspect their internals.
Change details
Commit: 8d47008
Affected packages:
- @fluidframework/runtime-utils
SharedString DDS annotateAdjustRange (#22751)
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.
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.
Key Features and Use Cases:
- 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.
- 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.
- 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.
Configuration and Compatibility Requirements:
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.
Usage Example:
sharedString.annotateAdjustRange(start, end, {
key: { value: 5, min: 0, max: 10 },
});
Change details
Commit: d54b9dd
Affected packages:
- fluid-framework
- @fluidframework/merge-tree
- @fluidframework/sequence
- @fluidframework/undo-redo
🌳 SharedTree DDS Changes
Provide more comprehensive replacement to the commitApplied
event (#22977)
Adds a new changed
event to the (currently alpha) TreeBranchEvents
that replaces the commitApplied
event on TreeViewEvents
. This new event is fired for both local and remote changes and maintains the existing functionality of commitApplied
that is used for obtaining Revertibles
.
Change details
Commit: e51c94d
Affected packages:
- @fluidframework/tree
SharedTree event listeners that implement Listenable
now allow deregistration of event listeners via an off()
function. (#23046)
The ability to deregister events via a callback returned by on()
remains the same. Both strategies will remain supported and consumers of SharedTree events may choose which method of deregistration they prefer in a given instance.
// The new behavior
function deregisterViaOff(view: TreeView<MySchema>): {
const listener = () => { /* ... */ };
view.events.on("commitApplied", listener); // Register
view.events.off("commitApplied", listener); // Deregister
}
// The existing behavior (still supported)
function deregisterViaCallback(view: TreeView<MySchema>): {
const off = view.events.on("commitApplied", () => { /* ... */ }); // Register
off(); // Deregister
}
Change details
Commit: c59225d
Affected packages:
- fluid-framework
- @fluidframework/tree
Allow constructing recursive maps from objects (#23070)
Previously only non-recursive maps could be constructed from objects. Now all maps nodes can constructed from objects:
class MapRecursive extends sf.mapRecursive("Map", [() => MapRecursive]) {}
{
type _check = ValidateRecursiveSchema<typeof MapRecursive>;
}
// New:
const fromObject = new MapRecursive({ x: new MapRecursive() });
// Existing:
const fromIterator = new MapRecursive([["x", new MapRecursive()]]);
const fromMap = new MapRecursive(new Map([["x", new MapRecursive()]]));
const fromNothing = new MapRecursive();
const fromUndefined = new MapRecursive(undefined);
Change details
Commit: 0185a08
Affected packages:
- fluid-framework
- @fluidframework/tree
Fix typing bug in adaptEnum
and enumFromStrings
(#23077)
When using the return value from adaptEnum
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.
Additionally enumFromStrings
has improved the typing of its schema, ensuring the returned object's members have sufficiently specific types. 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.
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. This means that narrowing based on .value
property narrows which node type you have, not just the value property. This mainly matters when matching all cases like the switch statement below:
const Mode = enumFromStrings(schema, ["Fun", "Bonus"]);
type Mode = TreeNodeFromImplicitAllowedTypes<typeof Mode.schema>;
const node = new Mode.Bonus() as Mode;
switch (node.value) {
case "Fun": {
assert.fail();
}
case "Bonus": {
// This one runs
break;
}
default:
// Before this change, "node.value" was never here, now "node" is never.
unreachableCase(node);
}
Change details
Commit: cfb6838
Affected packages:
- fluid-framework
- @fluidframework/tree
⚠️ Deprecations
Unsupported merge-tree types and related exposed internals have been removed (#22696)
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.
Removed types:
- IMergeTreeTextHelper
- MergeNode
- ObliterateInfo
- PropertiesManager
- PropertiesRollback
- SegmentGroup
- SegmentGroupCollection
In addition to removing the above types, they are no longer exposed through the following interfaces and their implementations: ISegment
, ReferencePosition
, and ISerializableInterval
.
Removed functions:
- addProperties
- ack
Removed properties:
- propertyManager
- segmentGroups
The initial deprecations of the now changed or removed types were announced in Fluid Framework v2.2.0: Fluid Framework v2.2.0
Change details
Commit: 7a03253
Affected packages:
- fluid-framework
- @fluidframework/merge-tree
- @fluidframework/sequence
Legacy API Changes
MergeTree Client
Legacy API Removed (#22697)
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.
The removed types were not meant to be used directly, and direct usage was not supported:
- AttributionPolicy
- IClientEvents
- IMergeTreeAttributionOptions
- SharedSegmentSequence
- SharedStringClass
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:
- SequenceInterval
- SequenceEvent
- SequenceDeltaEvent
- SequenceMaintenanceEvent
The initial deprecations of the now changed or removed types were announced in Fluid Framework v2.4.0: Several MergeTree Client Legacy APIs are now deprecated
Change details
Commit: 2aa0b5e
Affected packages:
- fluid-framework
- @fluidframework/merge-tree
- @fluidframework/sequence
The inbound and outbound properties have been removed from IDeltaManager (#22282)
The inbound and outbound properties were deprecated in version 2.0.0-rc.2.0.0 and have been removed from IDeltaManager
.
IDeltaManager.inbound
contained functionality that could break core runtime features such as summarization and processing batches if used improperly. Data loss or corruption could occur when IDeltaManger.inbound.pause()
or IDeltaManager.inbound.resume()
were called.
Similarly, IDeltaManager.outbound
contained functionality that could break core runtime features such as generation of batches and chunking. Data loss or corruption could occur when IDeltaManger.inbound.pause()
or IDeltaManager.inbound.resume()
were called.
Alternatives
- Alternatives to
IDeltaManager.inbound.on("op", ...)
areIDeltaManager.on("op", ...)
- Alternatives to calling
IDeltaManager.inbound.pause
,IDeltaManager.outbound.pause
forIContainer
disconnect useIContainer.disconnect
. - Alternatives to calling
IDeltaManager.inbound.resume
,IDeltaManager.outbound.resume
forIContainer
reconnect useIContainer.connect
.
Change details
Commit: 45a5769
Affected packages:
- @fluidframework/aqueduct
- @fluidframework/container-definitions
- @fluidframework/container-loader
- @fluidframework/container-runtime
- @fluidframework/container-runtime-definitions
- @fluidframework/datastore
- @fluidframework/devtools-core
- @fluidframework/fluid-static
- @fluidframework/runtime-definitions
- @fluidframework/runtime-utils
- @fluid-private/test-end-to-end-tests
- @fluidframework/test-runtime-utils
- @fluidframework/test-utils
"Remove IFluidParentContext.ensureNoDataModelChanges
and its implementations (#22842)
-
IFluidParentContext.ensureNoDataModelChanges
has been removed. prior deprecation commit -
MockFluidDataStoreContext.ensureNoDataModelChanges
has also been removed.
Change details
Commit: 3aff19a
Affected packages:
- @fluidframework/container-runtime
- @fluidframework/runtime-definitions
- @fluidframework/test-runtime-utils
Other Changes
Changes to the batchBegin and batchEnd events on ContainerRuntime (#22791)
The 'batchBegin'/'batchEnd' events on ContainerRuntime indicate when a batch is beginning or finishing being processed. The contents
property on the event argument op
is not useful or relevant when reasoning over incoming changes at the batch level. Accordingly, it has been removed from the op
event argument.
Change details
Commit: d252af5
Affected packages:
- @fluidframework/runtime-definitions
Presence package updates (#23021)
Package scope advanced from @fluid-experimental
(#23073)
To update existing:
- package.json: replace
@fluid-experimental/presence
with@fluidframework/presence
- code imports: replace
@fluid-experimental/presence
with@fluidframework/presence/alpha
The methods and properties of PresenceStates
have been reorganized (#23021)
The PresenceStatesEntries
object, which represents each of the states in the PresenceStates
schema, has been moved from directly within PresenceStates
to under property names props
. Only the add
method remains directly within PresenceStates
. The type PresenceStatesMethods
has also been removed since it is no longer used.
To update existing code, access your presence states from the props
property instead of directly on the PresenceStates
object. For example:
- presenceStatesWorkspace.myMap.local.get("key1");
+ presenceStatesWorkspace.props.myMap.local.get("key1");
BroadcastControls
replace LatestValueControls
(#23120)
BroadcastControls
maybe specified on PresenceStates
thru new controls
property as defaults for all value managers.
allowableUpdateLatencyMs
was renamed from allowableUpdateLatency
to clarify units are milliseconds. Specifying this value currently has no effect, but use is recommended to light up as implementation comes online.
Unsupported forcedRefreshInterval
has been removed until implementation is closer.
Change details
Commit: 365c5c0
Affected packages:
- @fluidframework/presence
🛠️ Start Building Today!
Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!