With this release, we're moving closer to General Availability of Fluid Framework 2.0 later this summer. We've made
major improvements to SharedTree DDS including features like Undo/Redo, Transactions, Events and other schema
improvements. We've also made upgrades to the Fluid DevTool, Telemetry and added support for Ephemeral containers in
Azure Fluid Relay.
New SharedTree features
Undo/Redo
Added the ability to listen for changes and track revertible objects on your undo/redo stacks. Revertibles allow you to undo and redo changes even if other changes have been made in remote clients.
Read more about Undo/redo at fluidframework.com
Transactions
You can group multiple changes such that they are applied atomically, and if they fail, they fail atomically. As a result of grouping changes in a transaction, you also get a single revertible object making it easier to undo and redo.
Read more about Transactions at fluidframework.com
Better events
We have updated the Events to make it easier to create granular event listeners for single nodes and better support the undo/redo feature. SharedTree nodes now expose nodeChanged
and treeChanged
events that fire in response to changes in the node, and to changes in the subtree rooted at the node, respectively.
This change was originally made in #20286 (ac1e773960).
Read more about SharedTree Events at fluidframework.com
Recursive schemas
Schemas are even more powerful now with the added support for recursive types, which allows you to define types that reference nodes of the same type in their subtree.
Users of the beta APIs via SchemaFactoryRecursive
can now find them on SchemaFactory
.
Read more about Recursive Schema at fluidframework.com
Other new features
New package: @fluidframework/fluid-telemetry
Before deploying your application at scale, it is critical to have the holistic telemetry in place to monitor its usage and look for issues and optimizations. To make this easier, we are providing a fluid-telemetry package that comes with Typed telemetry events that you can funnel to your any analytics tool of your choice. If you decide to use Azure App Insights to view this data, we also provide helper packages and dashboard queries to get you started quickly. You can learn more at https://aka.ms/fluid/telemetry.
Breaking changes
Packages now use package.json "exports" and require modern module resolution
Fluid Framework packages have been updated to use the package.json "exports" field to define explicit entry points for both TypeScript types and implementation code.
This means that using Fluid Framework packages require the following TypeScript settings in tsconfig.json:
"moduleResolution": "Node16"
with"module": "Node16"
"moduleResolution": "Bundler"
with"module": "ESNext"
We recommend using Node16/Node16 unless absolutely necessary. That will produce transpiled JavaScript that is suitable for use with modern versions of Node.js and Bundlers. See the TypeScript documentation for more information regarding the module and moduleResolution options.
Node10 moduleResolution is not supported; it does not support Fluid Framework's API structuring pattern that is used to distinguish stable APIs from those that are in development.
core-interfaces: Code details and package API surface removed
The code details and package API surface was deprecated in @fluidframework/core-interfaces in 0.53 and has now been removed. Please import them from @fluidframework/container-definitions instead. These include:
- IFluidCodeDetails
- IFluidCodeDetailsComparer
- IFluidCodeDetailsConfig
- IFluidPackage
- IFluidPackageEnvironment
- IProvideFluidCodeDetailsComparer
- isFluidCodeDetails
- isFluidPackage
fluid-framework: DDS classes are no longer publicly exported
SharedDirectory now only exports its factory and the interface type. The actual concrete classes which leak implementation details are no longer exported. Users of the SharedDirectory
type should use ISharedDirectory
.
Most of other internal crufts are also hided within the API surface, such as the encoded format, ILocalValue, ICreateInfo, local op metadata types, etc.
fluid-framework: Make some interface members readonly
Remove unneeded mutability from some interface members.
fluid-framework: Moved SharedMap to 'fluid-framework/legacy'
Please use SharedTree for new containers. SharedMap is supported for loading preexisting Fluid Framework 1.x containers only.
Fluid Framework 1.x users migrating to Fluid Framework 2.x will need to import SharedMap from the './legacy' import path.
import { SharedMap } from "fluid-framework/legacy";
fluid-framework: Replace SharedObjectClass with new ISharedObjectKind type.
The static objects used as SharedObjectClass now explicitly implement the new ISharedObjectKind type. SharedObjectClass has been removed as ISharedObjectKind now fills that role. LoadableObjectCtor has been inlined as it only had one use: an external user of it can replace it with (new (...args: any[]) => T)
.
Notable updates
tree: Allow root editing and make TreeView parameterized over schema.
TreeView now is parameterized over the field schema instead of the root field type. This was needed to infer the correct input type when reassigning the root. Code providing an explicit type to TreeView, like TreeView<Foo>
can usually be updated by replacing that with TreeView<typeof Foo>
.
tree: Empty optional fields on object nodes now are undefined non-enumerable own properties instead of not a property at all.
Empty optional fields on object nodes now are now undefined non-enumerable own properties. This improves behavior in cases where they shadow inherited members which no longer have types which differ from the runtime behavior.
Deprecations
None.
Updates to internal/legacy APIs
driver-definitions: update submitSignal content type to string
Change IDocumentDeltaConnection.submitSignal's content argument type to string which represents actual/known use.
container-definitions: IContainerContext.getSpecifiedCodeDetails() removed
IContainerContext.getSpecifiedCodeDetails() was deprecated in 0.42 and has now been removed.
Further updates
runtime-definitions: IFluidDataStoreContext no longer raises events, IFluidDataStoreChannel needs to implement new method
This change could be ignored, unless you have custom implementations of IFluidDataStoreChannel or listened to IFluidDataStoreContext's "attached" or "attaching" events
IFluidDataStoreContext no longer raises events. Instead, it will call IFluidDataStoreChannel.setAttachState(). If you are implementing data store runtme, please implement setAttachState() API and rely on this flow. If you are not data store developer, and were reaching out to context, then please stop doing it - the only purpose of IFluidDataStoreContext is communication with IFluidDataStoreChannel. Context object should not be exposed by impplementers of IFluidDataStoreChannel. If you are using stock implementations of IFluidDataStoreChannel, you can listen for same events on IFluidDataStoreRuntime instead.
test-driver-definitions: @fluidframework/test-driver-definitions moved to @fluid-internal/test-driver-definitions
The test-driver-definitions package is intended to aid in testing internal to the FluidFramework repo, and should not be used outside of the repo.