# Fluid Framework v2.90.0 ## Contents - [🚨 Breaking Changes](#-breaking-changes) - [@fluidframework/react no longer supports CommonJS (#26575)](#fluidframeworkreact-no-longer-supports-commonjs-26575) - [🌳 SharedTree DDS Changes](#-sharedtree-dds-changes) - [Promote checkSchemaCompatibilitySnapshots to beta (#26346)](#promote-checkschemacompatibilitysnapshots-to-beta-26346) - [Added new TreeAlpha.context(node) API (#26432)](#added-new-treealphacontextnode-api-26432) - [Add alpha TextAsTree domain for collaboratively editable text (#26568)](#add-alpha-textastree-domain-for-collaboratively-editable-text-26568) - [⚠️ Deprecations](#️-deprecations) - [Deprecated DDS implementation classes (#26501)](#deprecated-dds-implementation-classes-26501) ## 🚨 Breaking Changes ### @fluidframework/react no longer supports CommonJS ([#26575](https://github.com/microsoft/FluidFramework/issues/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`](https://github.com/microsoft/FluidFramework/commit/995c1e44aad7368e4e59ac4ff3a7237280506cde) Affected packages: - @fluidframework/react [⬆️ Table of contents](#contents) ## 🌳 SharedTree DDS Changes ### Promote checkSchemaCompatibilitySnapshots to beta ([#26346](https://github.com/microsoft/FluidFramework/issues/26346)) [`checkSchemaCompatibilitySnapshots`](https://fluidframework.com/docs/api/fluid-framework#checkschemacompatibilitysnapshots-function) 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: ```typescript 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`](https://github.com/microsoft/FluidFramework/commit/cb2204636b4b88f447d0542af108aac5b19c2a8c) Affected packages: - fluid-framework - @fluidframework/tree [⬆️ Table of contents](#contents) ### Added new TreeAlpha.context(node) API ([#26432](https://github.com/microsoft/FluidFramework/issues/26432)) This release introduces a node-scoped context that works for both hydrated and [unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) [TreeNodes](https://fluidframework.com/docs/api/fluid-framework/treenode-class). 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()`: ```ts 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: ```ts // A synchronous transaction without a return value const context = TreeAlpha.context(node); context.runTransaction(() => { node.count += 1; }); ``` ```ts // 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`](https://github.com/microsoft/FluidFramework/commit/ffa62f45e2ca6c6106c67ed94f69359336823516) Affected packages: - @fluidframework/tree - fluid-framework [⬆️ Table of contents](#contents) ### Add alpha TextAsTree domain for collaboratively editable text ([#26568](https://github.com/microsoft/FluidFramework/issues/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`](https://github.com/microsoft/FluidFramework/commit/06736bd81dea4c8e44cb13304f471a7b1bca42bd) Affected packages: - fluid-framework - @fluidframework/tree [⬆️ Table of contents](#contents) ## ⚠️ Deprecations ### Deprecated DDS implementation classes ([#26501](https://github.com/microsoft/FluidFramework/issues/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`](https://github.com/microsoft/FluidFramework/commit/583a96c3d44fa47095a0858d7da981afc574f64e) Affected packages: - @fluidframework/register-collection - @fluidframework/ordered-collection [⬆️ Table of contents](#contents) ### 🛠️ Start Building Today! Please continue to engage with us on GitHub [Discussion](https://github.com/microsoft/FluidFramework/discussions) and [Issue](https://github.com/microsoft/FluidFramework/issues) pages as you adopt Fluid Framework!