Contents
- ✨ New Features
- Experimental Presence package added (#22499)
- 🌳 SharedTree DDS changes
- Refactor code for emitting events to make it easier to copy into other projects (#22275)
- A
@beta
version ofnodeChanged
which includes the list of properties has been added (#22229) - Make SharedTree usable with legacy APIs (#22320)
- Implicitly constructed object nodes now only consider own properties during validation (#22453)
- Export SharedTree beta APIs from fluid-framework/beta (#22469)
- Add /alpha import path to @fluidframework/tree and fluid-framework packages (#22483)
- 🐛 Bug Fixes
- Restored old op processing behavior around batched ops to avoid potential regression (#22508)
- Other Changes
- Remove some experimental PropertyDDS-related packages (#22326)
✨ New Features
Experimental Presence package added (#22499)
@fluid-experimental/presence is now available for investigation. The new package is meant to support presence of collaborators connected to the same container. Use this library to quickly share simple, non-persisted data among all clients or send/receive fire and forget notifications.
API documentation for @fluid-experimental/presence is available at https://fluidframework.com/docs/apis/presence.
There are some limitations; see the README.md of installed package for most relevant notes.
We're just getting started. Please give it a go and share feedback.
Change details
Commit: 42b323c
Affected packages:
- @fluid-experimental/presence
⬆️ Table of contents
🌳 SharedTree DDS changes
Refactor code for emitting events to make it easier to copy into other projects (#22275)
Factored event emitting utilities into their own file, events/emitter.ts
. Applications wishing to use SharedTree's eventing library for custom events can copy this file (and its referenced utility function) as a starting point for defining and emitting their own custom events. See createEmitter
's documentation for example usage.
Currently there are no published or officially supported versions of these utilities, but they are relatively simple, and can be copied and customized as needed.
Change details
Commit: 49849bb
Affected packages:
- @fluidframework/tree
⬆️ Table of contents
A @beta
version of nodeChanged
which includes the list of properties has been added (#22229)
const factory = new SchemaFactory("example");
class Point2d extends factory.object("Point2d", {
x: factory.number,
y: factory.number,
}) {}
const point = new Point2d({ x: 0, y: 0 });
TreeBeta.on(point, "nodeChanged", (data) => {
const changed: ReadonlySet<"x" | "y"> = data.changedProperties;
if (changed.has("x")) {
// ...
}
});
The payload of the nodeChanged
event emitted by SharedTree's TreeBeta
includes a changedProperties
property that indicates which properties of the node changed.
For object nodes, the list of properties uses the property identifiers defined in the schema, and not the persisted identifiers (or "stored keys") that can be provided through FieldProps
when defining a schema. See the documentation for FieldProps
for more details about the distinction between "property keys" and "stored keys".
For map nodes, every key that was added, removed, or updated by a change to the tree is included in the list of properties.
For array nodes, the set of properties will always be undefined: there is currently no API to get details about changes to an array.
Object nodes revieve strongly types sets of changed keys, allowing compile time detection of incorrect keys:
TreeBeta.on(point, "nodeChanged", (data) => {
// @ts-expect-error Strong typing for changed properties of object nodes detects incorrect keys:
if (data.changedProperties.has("z")) {
// ...
}
});
The existing stable "nodeChanged" event's callback now is given a parameter called unstable
of type unknown
which is used to indicate that additional data can be provided there. This could break existing code using "nodeChanged" in a particularly fragile way.
function f(optional?: number) {
// ...
}
Tree.on(point, "nodeChanged", f); // Bad
Code like this which is implicitly discarding an optional argument from the function used as the listener will be broken. It can be fixed by using an inline lambda expression:
function f(optional?: number) {
// ...
}
Tree.on(point, "nodeChanged", () => f()); // Safe
Change details
Commit: aae34dd
Affected packages:
- fluid-framework
- @fluidframework/tree
⬆️ Table of contents
Make SharedTree usable with legacy APIs (#22320)
SharedTree was not previously exported in a way that made it usable with @fluidframework/aqueduct or other lower-level legacy APIs. This fixes that issue by making it consistent with other DDSes: such usages can import { SharedTree } from "@fluidframework/tree/legacy";
.
Change details
Commit: bbdf869
Affected packages:
- @fluidframework/tree
⬆️ Table of contents
Implicitly constructed object nodes now only consider own properties during validation (#22453)
When determining if some given data is compatible with a particular ObjectNode schema, both inherited and own properties were considered. However, when constructing the node from this data, only own properties were used. This allowed input which provided required values in inherited fields to pass validation. When the node was constructed, it would lack these fields, and end up out of schema. This has been fixed: both validation and node construction now only consider own properties.
This may cause some cases which previously exhibited data corruption to now throw a usage error reporting the data is incompatible. Such cases may need to copy data from the objects with inherited properties into new objects with own properties before constructing nodes from them.
Change details
Commit: 27faa56
Affected packages:
- @fluidframework/tree
- fluid-framework
⬆️ Table of contents
Export SharedTree beta APIs from fluid-framework/beta (#22469)
fluid-framework/beta
now contains the @beta
APIs from @fluidframework/tree/beta
.
Change details
Commit: c51f55c
Affected packages:
- fluid-framework
⬆️ Table of contents
Add /alpha import path to @fluidframework/tree and fluid-framework packages (#22483)
@fluidframework/tree
and fluid-framework
now have a /alpha
import path where their @alpha
APIs are exported.
Change details
Commit: 12242cf
Affected packages:
- fluid-framework
- @fluidframework/tree
⬆️ Table of contents
🐛 Bug Fixes
Restored old op processing behavior around batched ops to avoid potential regression (#22508)
There's a theoretical risk of indeterminate behavior due to a recent change to how batches of ops are processed. This fix reverses that change.
Pull Request #21785 updated the ContainerRuntime to hold onto the messages in an incoming batch until they've all arrived, and only then process the set of messages.
While the batch is being processed, the DeltaManager and ContainerRuntime's view of the latest sequence numbers will be out of sync. This may have unintended side effects, so out of an abundance of caution we're reversing this behavior until we can add the proper protections to ensure the system stays properly in sync.
Change details
Commit: 709f085
Affected packages:
- @fluidframework/container-runtime
⬆️ Table of contents
Other Changes
Remove some experimental PropertyDDS-related packages (#22326)
The following packages will no longer be published:
- @fluid-experimental/property-shared-tree-interop
- @fluid-experimental/property-binder
- @fluid-experimental/property-proxy
- @fluid-experimental/property-inspector-table
PropertyDDS itself and its dependencies will continue to be published.
Change details
Commit: 8db660e
Affected packages:
- @fluid-experimental/property-shared-tree-interop
- @fluid-experimental/property-binder
- @fluid-experimental/property-proxy
- @fluid-experimental/property-inspector-table
⬆️ Table of contents
🛠️ Start Building Today!
Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!