Fluid Framework v2.40.0 (minor)
Contents
- 🚨 Breaking Changes
- 🌳 SharedTree DDS Changes
- AllowedTypes array handling has been updated (#24484)
- SchemaFactoryAlpha.object has been renamed to SchemaFactoryAlpha.objectAlpha (#24478)
- SchemaFactoryAlpha supports adding metadata to AllowedTypes (#24478)
- A SharedTree document corruption bug has been fixed (#24565)
- The extractPersistedSchema (alpha) API has had its arguments adjusted (#24562)
⚠️ Deprecations- Legacy API Changes
🚨 Breaking Changes
ITokenClaims and ScopeType re-exports have been removed (#24530)
Import from @fluidframework/driver-definitions/legacy
as needed. See issue #23702.
Change details
Commit: 665a9f4
Affected packages:
- @fluidframework/azure-client
IContainer.getContainerPackageInfo has been removed (#24525)
IContainer.getContainerPackageInfo()
was set to be removed in release 2.40.0. To access the package name getContainerPackageInfo()
provided, use IFluidCodeDetails.package
returned by IContainer.getLoadedCodeDetails()
.
See issue #23898 for more information.
Change details
Commit: 15a5412
Affected packages:
- @fluidframework/container-definitions
- @fluidframework/container-loader
- fluid-framework
🌳 SharedTree DDS Changes
AllowedTypes array handling has been updated (#24484)
As an optimization, how AllowedTypes arrays are processed has changed. Now much larger arrays can be provided without hitting:
"Type instantiation is excessively deep and possibly infinite.ts"
Previously, arrays of around 43 schema would start having this issue, but now arrays of hundreds work correctly.
This optimization has resulted in a small change in behavior for how input types are computed. When the AllowedTypes
array has a type that is a union of two arrays, and the two arrays start with the same subsequence of types, previously this would allow the types from the common prefix of the arrays. For example [typeof A] | [typeof A, typeof B]
would permit inserting content compatible with A
. Now all such unions produce never
for their insertable node types (just like this example would if the order of the second array were reversed). This case was not intentionally supported, and as documented in input types, non-exact types, like these unions, are not guaranteed to produce anything other than never
.
If providing exact schema is impractical and the previous behavior is required, convert the union of arrays to an array of unions. The above example can be turned into [typeof A, typeof B | typeof A]
.
This is also fix for a case where AllowedTypes was order dependent, which violates its documented order independence.
Change details
Commit: f0a71cc
Affected packages:
- fluid-framework
- @fluidframework/tree
SchemaFactoryAlpha.object has been renamed to SchemaFactoryAlpha.objectAlpha (#24478)
This rename was done so that changes can be made to the signature of the class. This is a breaking change and uses of SchemaFactoryAlpha.object
may need to be changed to SchemaFactoryAlpha.objectAlpha
.
Change details
Commit: 12e5ab3
Affected packages:
- fluid-framework
- @fluidframework/tree
SchemaFactoryAlpha supports adding metadata to AllowedTypes (#24478)
This change allows metadata to be added to AllowedTypes
as well as individual types in a set of AllowedTypes
. Users can define custom metadata by putting their AllowedTypes
in an object with metadata
and types
properties:
schemaFactoryAlpha.arrayAlpha({
metadata: {
custom: "these allowed types are annotated",
},
types: [SchemaFactory.string, SchemaFactory.number],
});
This annotation system will also be used to implement future schema features.
Change details
Commit: 12e5ab3
Affected packages:
- fluid-framework
- @fluidframework/tree
A SharedTree document corruption bug has been fixed (#24565)
There was a bug where local changes were not correctly sent to peers. This could lead to a permanent loss of consistency and ultimately document corruption. See PR24561 for details.
Change details
Commit: 6b3e150
Affected packages:
- fluid-framework
- @fluidframework/tree
The extractPersistedSchema (alpha) API has had its arguments adjusted (#24562)
The extractPersistedSchema function has been updated to take in SimpleTreeSchema. This makes it possible to use with simple schema derived from stored schema, like those returned from ITreeAlpha.exportSimpleSchema. Like TreeAlpha.exportCompressed, extractPersistedSchema
now takes in FluidClientVersion to make it possible to opt into newer formats when they become available.
Additionally, persistedToSimpleSchema
has been added to fill in a gap in the API. Without persistedToSimpleSchema
it would be impossible to parse the persisted format without a valid compressed tree to provide to independentInitializedView.
Change details
Commit: 2e6b0cf
Affected packages:
- fluid-framework
- @fluidframework/tree
⚠️ Deprecations
IFluidHandleInternal.bind has been deprecated (#24553)
Handle binding is an internal concept used to make sure objects attach to the Container graph when their handle is stored in a DDS which is itself attached. The source of the "bind" operation has been assumed to be any handle, but only one implementation is actually supported (SharedObjectHandle
, not exported itself).
So the bind
function is now deprecated on the IFluidHandleInterface
, moving instead to internal types supporting the one valid implementation. It's also deprecated on the various exported handle implementations that don't support it (each is either no-op, pass-through, or throwing).
No replacement is offered, this API was never meant to be called from outside of the Fluid Framework.
Change details
Commit: 8a4362a
Affected packages:
- @fluidframework/container-runtime
- @fluidframework/core-interfaces
- @fluidframework/datastore
- @fluidframework/runtime-utils
- @fluidframework/shared-object-base
- @fluid-private/test-dds-utils
- @fluid-private/test-end-to-end-tests
- @fluidframework/test-runtime-utils
- @fluid-experimental/tree
Legacy API Changes
IDetachedBlobStorage (deprecated) has been removed from Loader (#24490)
It is no longer necessary or supported to provide detachedBlobStorage
to the Loader. This functionality is now provided by default, and the deprecated IDetachedBlobStorage
has been removed.
Change details
Commit: ef47644
Affected packages:
- @fluidframework/container-loader
IntervalCollections types (deprecated) have been removed (#24489)
This change removes the following deprecated generic types and provides non-generic alternatives where necessary:
IIntervalCollection
is replaced byISequenceIntervalCollection
IIntervalCollectionEvent
is replaced byISequenceIntervalCollectionEvents
IntervalIndex
is replaced bySequenceIntervalIndex
IOverlappingIntervalsIndex
is replaced byISequenceOverlappingIntervalsIndex
ISharedIntervalCollection
is deprecated without replacement
These types are no longer required to be generic, and replacing them with non-generic alternatives keeps the typing less complex.
Change details
Commit: a686c35
Affected packages:
- @fluidframework/sequence
🛠️ Start Building Today!
Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!