Skip to content

Releases: microsoft/FluidFramework

Fluid Framework v2.42.0 (minor)

10 Jun 06:02
d091a68
Compare
Choose a tag to compare

Contents

🌳 SharedTree DDS Changes

Fix Tree.key and Tree.parent for Unhydrated nodes after edits (#24708)

In some cases, editing Unhydrated nodes could result in incorrect results being returned from Tree.key and Tree.parent. This has been fixed.

Change details

Commit: 8aa5c23

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

Name collisions from structurally named schema now error (#24707)

It is legal to have multiple TreeNodeSchema with the same name so long as they are not used together in the same tree. Using different schema with the same name when building otherwise identical structurally named in the same SchemaFactory is not valid, however. Previously doing this would not error, and instead return the first structurally named schema with that name. Now this case throws an informative error:

const factory = new SchemaFactory(undefined);
class Child1 extends factory.object("Child", {}) {}
class Child2 extends factory.object("Child", {}) {}

const a = factory.map(Child1);

// Throws a UsageError with the message:
// "Structurally named schema collision: two schema named "Array<["Child"]>" were defined with different input schema."
const b = factory.array(Child2);

Change details

Commit: a343f04

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

Defaulted identifier fields on unhydrated nodes are now enumerable (#24739)

Previously, there was a special case for defaulted identifier fields on unhydrated nodes where they were not enumerable. This special case has been removed: they are now enumerable independent of hydration status and defaulting.

Change details

Commit: 3a5d0ac

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

🛠️ Start Building Today!

Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!

Fluid Framework v2.41.0 (minor)

27 May 23:21
8fb28e1
Compare
Choose a tag to compare

Contents

✨ New Features

Presence APIs promoted to beta (#24710)

Presence APIs are now beta and can be imported via @fluidframework/presence/beta.

Note: Notifications are only supported via /alpha imports. To access notifications-only workspace support, cast Presence to PresenceWithNotifications.

Change details

Commit: 6fce410

Affected packages:

  • @fluidframework/presence

⬆️ Table of contents

New experimental objectIdNumber API (#21115)

A new objectIdNumber has been added, which is useful when you need an identifier which corresponds to an object identity. For example: when specifying a React "key" that corresponds to a TreeNode.

Change details

Commit: df2f139

Affected packages:

  • @fluid-experimental/tree-react-api

⬆️ Table of contents

New TreeAlpha.key2 API (#24623)

The TreeAlpha.key2 method is meant to eventually replace the public Tree.key method. This new method returns undefined in the case where there is a root node.

Change details

Commit: 0ddd6b0

Affected packages:

  • @fluidframework/tree

⬆️ Table of contents

New TreeAlpha identifier APIs for converting, retrieving, and generating identifiers (#24218)

TreeAlpha.identifier

You can retrieve the long identifier with TreeAlpha.identifier(node), where node is a TreeNode. The long identifier is a stable, compressible UUID generated by the tree. In cases where the node does not yet have an identifier assigned, this will return undefined. These cases include:

  • The node does not contain an identifier field.
  • The node is a non-hydrated node with a user provided identifier. Note that if it is a non-hydrated node without an identifier provided, it will throw an error.

TreeAlpha.identifier.shorten

You can shorten a long identifier with TreeAlpha.identifier.shorten(branch, identifier), where branch is a TreeBranch, and identifier is a string. If the method returns a valid short identifier, this identifier can be passed into TreeAlpha.identifier.lengthen to get the original valid long identifier back. In the cases where it's not possible to shorten the identifier, it will return undefined. These cases include:

  • A compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree.
  • An identifier which is not compressible by the tree. This can occur if the node's identifier was a user provided string.

TreeAlpha.identifier.lengthen

You can lengthen a short identifier with TreeAlpha.identifier.lengthen(branch, identifier), where branch is a TreeBranch, and identifier is a number. If the method returns a valid long identifier, this identifier can be passed into TreeAlpha.identifier.shorten to get the original identifier back. In the cases where it's not possible to lengthen the identifier, this method will throw an error. These cases include:

  • An unrecognized short identifier. This can occur if the identifier is not generated from the tree.

TreeAlpha.identifier.getShort

You can retrieve the short identifier from a node with TreeAlpha.identifier.getShort(node) where node is a TreeNode. If it is not possible to retrieve the short identifier, it will return undefined

Example for a node with valid identifier
// This will retrieve the short identifier from the node.
const shortIdentifier = TreeAlpha.identifier.getShort(nodeWithValidIdentifier);
Examples for when you get undefined

In cases where the node provided does not contain an identifier that is recognized or compressible by the tree that the node belongs to, this method will return undefined. This will occur in the following cases:

  • The node is an non-hydrated node with a user provided identifier. Note that if it is an non-hydrated node without an identifier provided, it will throw an error.
  • The node does not contain an identifier field.
  • The node contains a compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree.
  • The node contains an identifier which is not compressible by its id compressor. This can occur if the node's identifier was a user provided string.
// This will return undefined
const shortIdentifier = TreeAlpha.identifier.getShort(node);

TreeAlpha.identifier.create

You can create a long identifier from a branch with TreeAlpha.identifier.create(branch) where branch is a TreeBranch.

const createdIdentifier = TreeAlpha.identifier.create(branch);

Change details

Commit: e5b2882

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

"getPresence(container: IFluidContainer): Presence" now supported (#24399)

You can now use the getPresence function to directly acquire Presence. In previous releases, you were required to use ExperimentalPresenceManager in container schema and calling getPresenceViaDataObject, but that is no longer required. Both ExperimentalPresenceManager and getPresenceViaDataObject are now deprecated.

Change details

Commit: 5c6824a

Affected packages:

  • @fluidframework/presence

⬆️ Table of contents

🌳 SharedTree DDS Changes

The comparePersistedSchema function (alpha) has had its canInitialize parameter removed (#24606)

comparePersistedSchema has had its canInitialize parameter removed. This parameter was only used to add to the output SchemaCompatibilityStatus. If a full SchemaCompatibilityStatus is still desired, the canInitialize value can be added to the result:

// old
const result = comparePersistedSchema(a, b, canInitialize);
// new
const result = { ...comparePersistedSchema(a, b), canInitialize };

Change details

Commit: d083a17

Affected packages:

  • fluid-framework
  • @fluidframework/tr...
Read more

Fluid Framework v2.40.0 (minor)

12 May 23:49
a62b432
Compare
Choose a tag to compare

Contents

🚨 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

⬆️ Table of contents

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

⬆️ Table of contents

🌳 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

⬆️ Table of contents

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

⬆️ Table of contents

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

⬆️ Table of contents

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

⬆️ Table of contents

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

⬆️ Table of contents

⚠️ 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 sto...

Read more

Fluid Framework v2.33.2 (patch)

01 May 19:54
510e071
Compare
Choose a tag to compare

What's Changed

  • perf(client-container-runtime): reduce semver bundle regression #24486
  • build(client): Bump version to 2.33.2 #24496

Full Changelog: client_v2.33.1...client_v2.33.2

Fluid Framework v2.33.1 (patch)

30 Apr 22:35
e809ac8
Compare
Choose a tag to compare

What's Changed

  • Bump patch version and type tests #24475

Full Changelog: client_v2.33.0...client_v2.33.1

Fluid Framework v2.33.0 (minor)

28 Apr 23:15
bb52ade
Compare
Choose a tag to compare

Contents

✨ New Features

Latest and LatestMap support more types (#24417)

  • Latest (StateFactory.latest) permits null so that nullable types may be used.
  • LatestMap (StateFactory.latestMap) permits boolean, number, string, and null.

Change details

Commit: 619af0b

Affected packages:

  • @fluidframework/presence

⬆️ Table of contents

🌳 SharedTree DDS Changes

Improve handling of deleted nodes (#24345)

TreeNodes which are deleted were not handled correctly. This has been improved in two ways:

  1. Accessing fields of deleted nodes now consistently throws a usage error indicating that doing so is invalid. Previously, this would throw an assertion error, which was a bug.
  2. When a TreeNode is deleted, but that node still exists within the ITree, then becomes accessible again later, a new TreeNode is now allocated instead of trying to reuse the deleted one. Note that this can only happen when the entire view of the ITree is disposed then recreated. This happens when disposing and recreating a TreeView or when the contents of the view are disposed due to being out of schema (another client did a schema upgrade), then brought back into schema (the schema upgrade was undone).

Change details

Commit: 0ab3e51

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

allowUnused utility function (#24076)

A new allowUnused utility function has been added, which discards its type or runtime argument. When TypeScript is configured to reject code with unused locals, this function can be used to suppress that error, enabling use of ValidateRecursiveSchema to compile.

class Test extends sf.arrayRecursive("Test", () => Test) {} // Bad
allowUnused<ValidateRecursiveSchema<typeof Test>>(); // Reports compile error due to invalid schema above.

Change details

Commit: 13c62b6

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

Typing derived from unions of AllowedTypes arrays is fixed (#24441)

Unions of array types provided as an AllowedTypes used to result in incorrectly computed insertable content types. This happened because InsertableTreeNodeFromAllowedTypes distributed over the union, violating the policy documented in Input for how schema-derived input types should be computed. This has been fixed. To get usable Input types, SharedTree schema's types should always capture the exact schema provided at runtime and not unions of possible different schema. Any code impacted by this change should be updated to replace any such unions with more specific types.

Change details

Commit: a27ef0a

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

Remote edits to nodes which have never been accessed locally correctly trigger "treeChanged" events (#24421)

There was a bug where "treeChanged" events would not always trigger if the node that was edited had never been accessed in the current view. This has been fixed.

Change details

Commit: 916ad05

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

"Unsafe" @System types moved to System_Unsafe namespace (#24443)

Working code conforming to the rules regarding API Support Levels should be unaffected, but this resolves an issue which required violating these rules and directly referencing @system types.

Sometimes packages exporting SharedTree schema related types for recursive schema could yield errors like:

error TS2742: The inferred type of 'YourSchema' cannot be named without a reference to '../node_modules/@fluidframework/tree/lib/internalTypes.js'. This is likely not portable. A type annotation is necessary.

Mitigating this error could require explicitly referencing these @system types from internalTypes. Any such references to the moved types should be able to be deleted, as TypeScript will now be able to find them in the new namespace without assistance.

This does not migrate all types out of internalTypes, so some occurrences of this issue may remain.

Change details

Commit: dd4abfc

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

⚠️ Deprecations

Generic types for IntervalCollections have been replaced with non-generic types (#24164)

This change deprecates the following generic types and provides non-generic alternatives where necessary:

  • IIntervalCollection is replaced by ISequenceIntervalCollection
  • IIntervalCollectionEvent is replaced by ISequenceIntervalCollectionEvents
  • IntervalIndex is replaced by SequenceIntervalIndex
  • IOverlappingIntervalsIndex is replaced by ISequenceOverlappingIntervalsIndex
  • ISharedIntervalCollection is deprecated without replacement

These types are no longer required to be generic, and replacing them with non-generic alternatives keeps our typing less complex.

Change details

Commit: 280e2bc

Affected packages:

  • fluid-framework
  • @fluidframework/sequence

⬆️ Table of contents

Other Changes

Presence APIs have been renamed (#24384)

The following API changes have been made to improve clarity and consistency:

Before 2.33.0 2.33.0
acquirePresence ...
Read more

build-tools v0.56.0 (minor)

15 Apr 23:14
02c5170
Compare
Choose a tag to compare

This is a minor release.

Fluid Framework v2.32.0 (minor)

15 Apr 20:29
6fcd178
Compare
Choose a tag to compare

Contents

✨ New Features

Blobs in Detached Container Supported by Default (#24119)

It is no longer necessary or supported to provide detachedBlobStorage to the Loader. This functionality is now provided by default, and the deprecated IDetachedBlobStorage will be removed in the 2.40.0 release. The new behavior can be disabled by setting Fluid.Container.MemoryBlobStorageEnabled to false. This flag will also be removed in the 2.40.0 release if no issues are reported.

Change details

Commit: fcf561a

Affected packages:

  • @fluidframework/container-loader

⬆️ Table of contents

Shorter IDs for DataStores and DDSes (#24231)

Fluid Framework will now use shorter IDs for Datastores and DDSes when enableRuntimeIdCompressor:"on" is set in IContainerRuntimeOptions. This change should help reduce summary and snapshot sizes as well as improve runtime performance because of a smaller memory footprint.

Change details

Commit: 27bbb87

Affected packages:

  • @fluidframework/container-runtime
  • @fluidframework/datastore

⬆️ Table of contents

🌳 SharedTree DDS Changes

Cleanup of several tree and schema alpha APIs for content import and export (#24255)

A new TreeSchema type has been introduced which extends SimpleTreeSchema but contains TreeNodeSchema instead of SimpleNodeSchema.

TreeViewConfigurationAlpha is added which is just TreeViewConfiguration but implementing TreeSchema.

SimpleTreeSchema was modified to have a root property instead of implementing SimpleFieldSchema directly: this makes it possible for TreeViewConfigurationAlpha to implement TreeSchema which extends SimpleTreeSchema.

generateSchemaFromSimpleSchema now returns the new TreeSchema type.

EncodeOptions and ParseOptions have been unified as TreeEncodingOptions which covers both the encoding and parsing cases.

getJsonSchema now takes in ImplicitAllowedTypes instead of ImplicitFieldSchema since it can't handle optional roots. getJsonSchema also takes in the new TreeSchemaEncodingOptions to provide options for how to handle stored keys vs property keys, and fields with defaults.

Now that getJsonSchema takes in configuration options, its results are no longer cached.

Change details

Commit: c6563e5

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

Provide alpha APIs for accessing tree content and stored schema without requiring a compatible view schema (#24225)

Adds an ITreeAlpha interface (which ITree can be down-casted to) that provides access to both the tree content and the schema. This allows inspecting the content saved in a SharedTree in a generic way that can work on any SharedTree.

This can be combined with the existing generateSchemaFromSimpleSchema to generate a schema that can be used with IIree.viewWith to allow constructing a TreeView for any SharedTree, regardless of its schema.

Note that the resulting TypeScript typing for such a view will not be friendly: the TreeView APIs are designed for statically known schema. Using them is possible with care and a lot of type casts but not recommended if it can be avoided: see disclaimer on generateSchemaFromSimpleSchema. Example using ITreeAlpha and generateSchemaFromSimpleSchema:

const viewAlpha = tree as ITreeAlpha;
const treeSchema = generateSchemaFromSimpleSchema(
  viewAlpha.exportSimpleSchema(),
);
const config = new TreeViewConfiguration({ schema: treeSchema.root });
const view = viewAlpha.viewWith(config);

getSimpleSchema is also added as an @alpha API to provide a way to clone schema into the simple schema formats. Note that when using (or copying) a view schema as a simple schema, more metadata will be preserved than when deriving one from the stored schema using ITreeAlpha.

Change details

Commit: 18b6e05

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

⚠️ Deprecations

The containerPackageInfo parameter in createOdspCreateContainerRequest() is now deprecated (#23919)

The containerPackageInfo parameter in createOdspCreateContainerRequest() is now deprecated and will be removed in version 2.40.0.

The name of the containerPackage can no longer be sent through the request. Instead, it can be added in the constructor of OdspDriverUrlResolverForShareLink.

See issue #23882 for more details.

Change details

Commit: 42b26b7

Affected packages:

  • @fluidframework/odsp-driver

⬆️ Table of contents

🛠️ Start Building Today!

Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!

build-tools v0.55.0 (minor)

08 Apr 17:17
aed9c7b
Compare
Choose a tag to compare

This is a minor release.

Fluid Framework v2.31.1 (patch)

04 Apr 19:25
f9f6780
Compare
Choose a tag to compare

What's Changed

  • Update handlecache.ts (#24233) #24256
  • build(client): Bump to version 2.31.1 and update type test baselines #24241

Full Changelog: client_v2.31.0...client_v2.31.1