Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
356484f
Tweaks to checkSchemaCompatibilitySnapshots
CraigMacomber Feb 3, 2026
7fc5271
Fix example import paths to alpha
CraigMacomber Feb 3, 2026
4731a4a
Update packages/dds/tree/src/simple-tree/api/snapshotCompatibilityChe…
CraigMacomber Feb 3, 2026
311ded1
Update packages/dds/tree/src/simple-tree/api/snapshotCompatibilityChe…
CraigMacomber Feb 3, 2026
97a0bd2
Update packages/dds/tree/src/simple-tree/api/snapshotCompatibilityChe…
CraigMacomber Feb 3, 2026
514675b
Remove bad path in docs
CraigMacomber Feb 3, 2026
de34009
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
CraigMacomber Feb 3, 2026
d832824
Fix and test custom versionComparer
CraigMacomber Feb 3, 2026
e9a5f7e
Renames
CraigMacomber Feb 4, 2026
c0c65d5
Tweak API
CraigMacomber Feb 4, 2026
be4f8c7
Merge branch 'main' of https://github.com/CraigMacomber/FluidFramewor…
CraigMacomber Feb 4, 2026
40b1b57
Fix typo
CraigMacomber Feb 6, 2026
727086f
New flag based API
CraigMacomber Feb 6, 2026
3a20f95
Update implementation to support reject flags
CraigMacomber Feb 6, 2026
1ab1f85
fix equality case in CombinedSchemaCompatibilityStatus, and fix tests
CraigMacomber Feb 7, 2026
3bb15e8
Fix extra notice in errors
CraigMacomber Feb 7, 2026
ec3731c
more tests
CraigMacomber Feb 7, 2026
1354a12
Fix build
CraigMacomber Feb 7, 2026
00b4040
Fix example docs
CraigMacomber Feb 7, 2026
adfdbca
Apply suggestions from code review
CraigMacomber Feb 10, 2026
da8b129
Merge branch 'main' of https://github.com/microsoft/FluidFramework in…
CraigMacomber Feb 10, 2026
2fdd91f
Fix paths in expected errors
CraigMacomber Feb 12, 2026
dcd05a6
Merge branch 'main' into schemaCompatBetter
CraigMacomber Feb 12, 2026
e17c301
rename nextReleaseVersion back to version, and update docs
CraigMacomber Feb 12, 2026
292d529
Update APi reports
CraigMacomber Feb 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions examples/apps/tree-cli-app/src/test/schema.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import fs from "node:fs";
import path from "node:path";

import { checkSchemaCompatibilitySnapshots } from "@fluidframework/tree/alpha";
import { snapshotSchemaCompatibility } from "@fluidframework/tree/alpha";

import { config } from "../schema.js";

Expand All @@ -22,15 +22,15 @@ describe("schema", () => {
);
// This app does not actually support a stable document format, so the versions used here are arbitrary.
// Despite this, testing the schema for compatibility issues is a useful example of how apps should do this,
// and testing the checkSchemaCompatibilitySnapshots API.
// and testing the snapshotSchemaCompatibility API.
// This app has a dummy legacy version 1.0.0 schema so it can include a compatibility test for upgrading an old schema.
checkSchemaCompatibilitySnapshots({
snapshotSchemaCompatibility({
snapshotDirectory,
fileSystem: { ...fs, ...path },
version: "2.0.0",
schema: config,
minVersionForCollaboration: "2.0.0",
mode: regenerateSnapshots ? "update" : "test",
mode: regenerateSnapshots ? "update" : "assert",
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import path from "node:path";

import { toPropTreeNode } from "@fluidframework/react/alpha";
import { render } from "@testing-library/react";
import { checkSchemaCompatibilitySnapshots } from "fluid-framework/alpha";
import { snapshotSchemaCompatibility } from "fluid-framework/alpha";
import globalJsdom from "global-jsdom";
import * as React from "react";

Expand All @@ -36,14 +36,14 @@ describe("inventoryApp", () => {
);
// This app does not actually support a stable document format, so the versions used here are arbitrary.
// Despite this, testing the schema for compatibility issues is a useful example of how apps should do this,
// and testing the checkSchemaCompatibilitySnapshots API.
checkSchemaCompatibilitySnapshots({
// and testing the snapshotSchemaCompatibility API.
snapshotSchemaCompatibility({
snapshotDirectory,
fileSystem: { ...fs, ...path },
version: "1.0.0",
schema: treeConfiguration,
minVersionForCollaboration: "1.0.0",
mode: regenerateSnapshots ? "update" : "test",
mode: regenerateSnapshots ? "update" : "assert",
});
});

Expand Down
31 changes: 17 additions & 14 deletions packages/dds/tree/api-report/tree.alpha.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ export type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;
// @alpha
export function checkCompatibility(viewWhichCreatedStoredSchema: TreeViewConfiguration, view: TreeViewConfiguration): Omit<SchemaCompatibilityStatus, "canInitialize">;

// @alpha
export function checkSchemaCompatibilitySnapshots(options: SchemaCompatibilitySnapshotsOptions): void;

// @alpha
export function cloneWithReplacements(root: unknown, rootKey: string, replacer: (key: string, value: unknown) => {
clone: boolean;
Expand Down Expand Up @@ -976,17 +973,6 @@ export interface RunTransactionParams {
readonly preconditions?: readonly TransactionConstraintAlpha[];
}

// @alpha @input
export interface SchemaCompatibilitySnapshotsOptions {
readonly fileSystem: SnapshotFileSystem;
readonly minVersionForCollaboration: string;
readonly mode: "test" | "update";
readonly schema: TreeViewConfiguration;
readonly snapshotDirectory: string;
readonly snapshotUnchangedVersions?: true;
readonly version: string;
}

// @public @sealed
export interface SchemaCompatibilityStatus {
readonly canInitialize: boolean;
Expand Down Expand Up @@ -1223,6 +1209,23 @@ export interface SnapshotFileSystem {
}): void;
}

// @alpha
export function snapshotSchemaCompatibility(options: SnapshotSchemaCompatibilityOptions): void;

// @alpha @input
export interface SnapshotSchemaCompatibilityOptions {
readonly fileSystem: SnapshotFileSystem;
readonly minVersionForCollaboration: string;
readonly mode: "assert" | "update";
readonly rejectSchemaChangesWithNoVersionChange?: true;
readonly rejectVersionsWithNoSchemaChange?: true;
readonly schema: TreeViewConfiguration;
readonly snapshotDirectory: string;
readonly snapshotUnchangedVersions?: true;
readonly version: string;
readonly versionComparer?: (a: string, b: string) => number;
}

// @beta @system
export namespace System_TableSchema {
// @sealed @system
Expand Down
4 changes: 2 additions & 2 deletions packages/dds/tree/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ export {
exportCompatibilitySchemaSnapshot,
importCompatibilitySchemaSnapshot,
checkCompatibility,
checkSchemaCompatibilitySnapshots,
snapshotSchemaCompatibility,
type SnapshotFileSystem,
incrementalSummaryHint,
incrementalEncodingPolicyForAllowedTypes,
eraseSchemaDetails,
eraseSchemaDetailsSubclassable,
type SchemaCompatibilitySnapshotsOptions,
type SnapshotSchemaCompatibilityOptions,
type ArrayPlaceAnchor,
createArrayInsertionAnchor,
} from "./simple-tree/index.js";
Expand Down
4 changes: 2 additions & 2 deletions packages/dds/tree/src/simple-tree/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export {
exportCompatibilitySchemaSnapshot,
importCompatibilitySchemaSnapshot,
checkCompatibility,
checkSchemaCompatibilitySnapshots,
snapshotSchemaCompatibility,
type SnapshotFileSystem,
type SchemaCompatibilitySnapshotsOptions,
type SnapshotSchemaCompatibilityOptions,
} from "./snapshotCompatibilityChecker.js";
Loading
Loading