github microsoft/FluidFramework client_v2.90.0
Fluid Framework v2.90.0 (minor)

7 hours ago

Contents

  • 🚨 Breaking Changes
    • @fluidframework/react no longer supports CommonJS (#26575)
  • 🌳 SharedTree DDS Changes
    • Promote checkSchemaCompatibilitySnapshots to beta (#26346)
    • Added new TreeAlpha.context(node) API (#26432)
    • Add alpha TextAsTree domain for collaboratively editable text (#26568)
  • ⚠️ Deprecations
    • Deprecated DDS implementation classes (#26501)

🚨 Breaking Changes

@fluidframework/react no longer supports CommonJS (#26575)

CommonJS support has been removed from @fluidframework/react. This package currently only has alpha APIs, so this opportunity was taken to simplify and modernize it while we still can.

Change details

Commit: 995c1e4

Affected packages:

  • @fluidframework/react

⬆️ Table of contents

🌳 SharedTree DDS Changes

Promote checkSchemaCompatibilitySnapshots to beta (#26346)

checkSchemaCompatibilitySnapshots has been promoted to @beta. It is recommended that all SharedTree applications use this API to write schema compatibility tests.

Usage should look something like:

import fs from "node:fs";
import path from "node:path";

import { snapshotSchemaCompatibility } from "@fluidframework/tree/beta";

// The TreeViewConfiguration the application uses, which contains the application's schema.
import { treeViewConfiguration } from "./schema.js";
// The next version of the application which will be released.
import { packageVersion } from "./version.js";

// Provide some way to run the check in "update" mode when updating snapshots is intended.
const regenerateSnapshots = process.argv.includes("--snapshot");

// Setup the actual test. In this case using Mocha syntax.
describe("schema", () => {
  it("schema compatibility", () => {
    // Select a path to save the snapshots in.
    // This will depend on how your application organizes its test data.
    const snapshotDirectory = path.join(
      import.meta.dirname,
      "../../../src/test/snapshotCompatibilityCheckerExample/schema-snapshots",
    );
    snapshotSchemaCompatibility({
      snapshotDirectory,
      fileSystem: { ...fs, ...path },
      version: packageVersion,
      minVersionForCollaboration: "2.0.0",
      schema: treeViewConfiguration,
      mode: regenerateSnapshots ? "update" : "assert",
    });
  });
});

Change details

Commit: cb22046

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

Added new TreeAlpha.context(node) API (#26432)

This release introduces a node-scoped context that works for both hydrated and unhydrated TreeNodes. The new TreeContextAlpha interface exposes runTransaction / runTransactionAsync methods and an isBranch() type guard. TreeBranchAlpha now extends TreeContextAlpha, so you can keep using branch APIs when available.

Migration

If you previously used TreeAlpha.branch(node) to discover a branch, switch to TreeAlpha.context(node) and check isBranch():

import { TreeAlpha } from "@fluidframework/tree/alpha";

const context = TreeAlpha.context(node);
if (context.isBranch()) {
  // Same branch APIs as before
  context.fork();
}

TreeAlpha.branch(node) is now deprecated. Prefer the context API above.

New transaction entry point

You can now run transactions from a node context, regardless of whether the node is hydrated:

// A synchronous transaction without a return value
const context = TreeAlpha.context(node);
context.runTransaction(() => {
  node.count += 1;
});
// An asynchronous transaction with a return value
const context = TreeAlpha.context(node);
const result = await context.runTransactionAsync(async () => {
  await doWork(node);
  return { value: node.foo };
});

Change details

Commit: ffa62f4

Affected packages:

  • @fluidframework/tree
  • fluid-framework

⬆️ Table of contents

Add alpha TextAsTree domain for collaboratively editable text (#26568)

A newly exported TextAsTree alpha namespace has been added with an initial version of collaboratively editable text. Users of SharedTree can add TextAsTree.Tree nodes to their tree to experiment with it.

Change details

Commit: 06736bd

Affected packages:

  • fluid-framework
  • @fluidframework/tree

⬆️ Table of contents

⚠️ Deprecations

Deprecated DDS implementation classes (#26501)

The following DDS implementation classes are now deprecated and will be removed in a future release:

  • ConsensusRegisterCollectionClass — use ConsensusRegisterCollectionFactory to create instances and IConsensusRegisterCollection for typing
  • ConsensusOrderedCollection — use IConsensusOrderedCollection for typing
  • ConsensusQueueClass — use the ConsensusQueue singleton to create instances and IConsensusOrderedCollection for typing

Change details

Commit: 583a96c

Affected packages:

  • @fluidframework/register-collection
  • @fluidframework/ordered-collection

⬆️ Table of contents

🛠️ Start Building Today!

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

Don't miss a new FluidFramework release

NewReleases is sending notifications on new releases.