fluid-framework 2.74.0 → 2.81.0-374083

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # fluid-framework
2
2
 
3
+ ## 2.80.0
4
+
5
+ ### Minor Changes
6
+
7
+ - TreeBranch operations throw when called during transactions ([#26097](https://github.com/microsoft/FluidFramework/pull/26097)) [33b1ec0827c](https://github.com/microsoft/FluidFramework/commit/33b1ec0827c433ce9afc126f26457a9245bd43eb)
8
+
9
+ This breaking change only affects the behavior of `TreeBranch` methods (currently released as beta).
10
+ - Invoking `TreeBranch.fork()` now throws an error if a transaction is ongoing on the branch.
11
+ - Invoking `TreeBranch.merge(sourceBranch)` now throws an error if a transaction is ongoing on the source branch.
12
+ As before, it also throws an error if a transaction is ongoing on the target (i.e., `this`) branch.
13
+ - Invoking `TreeBranch.rebaseOnto(targetBranch)` now throws an error if a transaction is ongoing on the target branch.
14
+ As before, it also throws an error if a transaction is ongoing on the source (i.e., `this`) branch.
15
+
16
+ These new restrictions insulate branches and their dependents from experiencing incomplete transaction changes.
17
+ This is important because incomplete transaction changes may not uphold application invariants.
18
+
19
+ In scenarios that experience the new errors, application authors should consider whether the ongoing transaction can safely be closed before invoking these methods.
20
+
3
21
  ## 2.74.0
4
22
 
5
23
  ### Minor Changes
@@ -142,26 +142,28 @@ export interface BranchableTree extends ViewableTree {
142
142
  }
143
143
 
144
144
  // @alpha @sealed
145
- export type ChangeMetadata = CommitMetadata & ({
146
- readonly isLocal: true;
147
- getChange(): JsonCompatibleReadOnly;
148
- } | {
149
- readonly isLocal: false;
150
- readonly getChange?: undefined;
151
- });
145
+ export type ChangeMetadata = LocalChangeMetadata | RemoteChangeMetadata;
152
146
 
153
147
  // @alpha
154
148
  export function checkCompatibility(viewWhichCreatedStoredSchema: TreeViewConfiguration, view: TreeViewConfiguration): Omit<SchemaCompatibilityStatus, "canInitialize">;
155
149
 
150
+ // @alpha
151
+ export function checkSchemaCompatibilitySnapshots(options: SchemaCompatibilitySnapshotsOptions): void;
152
+
156
153
  // @alpha
157
154
  export function cloneWithReplacements(root: unknown, rootKey: string, replacer: (key: string, value: unknown) => {
158
155
  clone: boolean;
159
156
  value: unknown;
160
157
  }): unknown;
161
158
 
159
+ // @alpha
160
+ export type CodecName = string;
161
+
162
162
  // @alpha @input
163
163
  export interface CodecWriteOptions extends ICodecOptions {
164
+ readonly allowPossiblyIncompatibleWriteVersionOverrides?: boolean;
164
165
  readonly minVersionForCollab: MinimumVersionForCollab;
166
+ readonly writeVersionOverrides?: ReadonlyMap<CodecName, FormatVersion>;
165
167
  }
166
168
 
167
169
  // @public
@@ -411,6 +413,7 @@ export const FluidClientVersion: {
411
413
  readonly v2_52: "2.52.0";
412
414
  readonly v2_73: "2.73.0";
413
415
  readonly v2_74: "2.74.0";
416
+ readonly v2_80: "2.80.0";
414
417
  };
415
418
 
416
419
  // @public
@@ -473,6 +476,9 @@ export const FormatValidatorBasic: FormatValidator_2;
473
476
  // @alpha
474
477
  export const FormatValidatorNoOp: FormatValidator;
475
478
 
479
+ // @alpha
480
+ export type FormatVersion = number | string | undefined;
481
+
476
482
  // @alpha
477
483
  export function generateSchemaFromSimpleSchema(simple: SimpleTreeSchema): TreeSchema;
478
484
 
@@ -1048,6 +1054,13 @@ export type Listeners<T extends object> = {
1048
1054
  [P in (string | symbol) & keyof T as IsListener<T[P]> extends true ? P : never]: T[P];
1049
1055
  };
1050
1056
 
1057
+ // @alpha @sealed
1058
+ export interface LocalChangeMetadata extends CommitMetadata {
1059
+ getChange(): JsonCompatibleReadOnly;
1060
+ getRevertible(onDisposed?: (revertible: RevertibleAlpha) => void): RevertibleAlpha | undefined;
1061
+ readonly isLocal: true;
1062
+ }
1063
+
1051
1064
  // @public @sealed
1052
1065
  export interface MakeNominal {
1053
1066
  }
@@ -1090,6 +1103,12 @@ export type Myself<M extends IMember = IMember> = M & {
1090
1103
  readonly currentConnection: string;
1091
1104
  };
1092
1105
 
1106
+ // @alpha
1107
+ export interface NoChangeConstraint {
1108
+ // (undocumented)
1109
+ readonly type: "noChange";
1110
+ }
1111
+
1093
1112
  // @public @system
1094
1113
  type NodeBuilderData<T extends TreeNodeSchemaCore<string, NodeKind, boolean>> = T extends TreeNodeSchemaCore<string, NodeKind, boolean, unknown, infer TBuild> ? TBuild : never;
1095
1114
 
@@ -1215,6 +1234,13 @@ export const RecordNodeSchema: {
1215
1234
  readonly [Symbol.hasInstance]: (value: TreeNodeSchema) => value is RecordNodeSchema<string, ImplicitAllowedTypes, true, unknown>;
1216
1235
  };
1217
1236
 
1237
+ // @alpha @sealed
1238
+ export interface RemoteChangeMetadata extends CommitMetadata {
1239
+ readonly getChange?: undefined;
1240
+ readonly getRevertible?: undefined;
1241
+ readonly isLocal: false;
1242
+ }
1243
+
1218
1244
  // @alpha
1219
1245
  export function replaceConciseTreeHandles<T>(tree: ConciseTree, replacer: HandleConverter<T>): ConciseTree<T>;
1220
1246
 
@@ -1288,7 +1314,18 @@ export interface RunTransaction {
1288
1314
 
1289
1315
  // @alpha @input
1290
1316
  export interface RunTransactionParams {
1291
- readonly preconditions?: readonly TransactionConstraint[];
1317
+ readonly preconditions?: readonly TransactionConstraintAlpha[];
1318
+ }
1319
+
1320
+ // @alpha @input
1321
+ export interface SchemaCompatibilitySnapshotsOptions {
1322
+ readonly fileSystem: SnapshotFileSystem;
1323
+ readonly minVersionForCollaboration: string;
1324
+ readonly mode: "test" | "update";
1325
+ readonly schema: TreeViewConfiguration;
1326
+ readonly snapshotDirectory: string;
1327
+ readonly snapshotUnchangedVersions?: true;
1328
+ readonly version: string;
1292
1329
  }
1293
1330
 
1294
1331
  // @public @sealed
@@ -1435,6 +1472,7 @@ export interface SharedTreeFormatOptions {
1435
1472
 
1436
1473
  // @alpha @input
1437
1474
  export interface SharedTreeOptions extends SharedTreeOptionsBeta, Partial<CodecWriteOptions>, Partial<SharedTreeFormatOptions> {
1475
+ readonly enableDetachedRootEditing?: boolean;
1438
1476
  readonly enableSharedBranches?: boolean;
1439
1477
  shouldEncodeIncrementally?: IncrementalEncodingPolicy;
1440
1478
  }
@@ -1522,6 +1560,19 @@ export function singletonSchema<TScope extends string, TName extends string | nu
1522
1560
  readonly value: TName;
1523
1561
  }, Record<string, never>, true, Record<string, never>, undefined>;
1524
1562
 
1563
+ // @alpha @input
1564
+ export interface SnapshotFileSystem {
1565
+ join(parentPath: string, childPath: string): string;
1566
+ mkdirSync(dir: string, options: {
1567
+ recursive: true;
1568
+ }): void;
1569
+ readdirSync(dir: string): readonly string[];
1570
+ readFileSync(file: string, encoding: "utf8"): string;
1571
+ writeFileSync(file: string, data: string, options: {
1572
+ encoding: "utf8";
1573
+ }): void;
1574
+ }
1575
+
1525
1576
  // @alpha @system
1526
1577
  export namespace System_TableSchema {
1527
1578
  // @sealed @system
@@ -1770,12 +1821,15 @@ export type TransactionCallbackStatus<TSuccessValue, TFailureValue> = ({
1770
1821
  rollback: true;
1771
1822
  value: TFailureValue;
1772
1823
  }) & {
1773
- preconditionsOnRevert?: readonly TransactionConstraint[];
1824
+ preconditionsOnRevert?: readonly TransactionConstraintAlpha[];
1774
1825
  };
1775
1826
 
1776
1827
  // @public
1777
1828
  export type TransactionConstraint = NodeInDocumentConstraint;
1778
1829
 
1830
+ // @alpha @sealed
1831
+ export type TransactionConstraintAlpha = TransactionConstraint | NoChangeConstraint;
1832
+
1779
1833
  // @alpha
1780
1834
  export type TransactionResult = Omit<TransactionResultSuccess<unknown>, "value"> | Omit<TransactionResultFailed<unknown>, "value">;
1781
1835
 
@@ -800,7 +800,9 @@ export interface ISharedDirectory extends ISharedObject<ISharedDirectoryEvents &
800
800
  // @beta @sealed @legacy
801
801
  export interface ISharedDirectoryEvents extends ISharedObjectEvents {
802
802
  (event: "valueChanged", listener: (changed: IDirectoryValueChanged, local: boolean, target: IEventThisPlaceHolder) => void): any;
803
+ // @deprecated
803
804
  (event: "clear", listener: (local: boolean, target: IEventThisPlaceHolder) => void): any;
805
+ (event: "cleared", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
804
806
  (event: "subDirectoryCreated", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
805
807
  (event: "subDirectoryDeleted", listener: (path: string, local: boolean, target: IEventThisPlaceHolder) => void): any;
806
808
  }
package/dist/alpha.d.ts CHANGED
@@ -196,6 +196,7 @@ export {
196
196
  ArrayNodeSchema,
197
197
  BranchableTree,
198
198
  ChangeMetadata,
199
+ CodecName,
199
200
  CodecWriteOptions,
200
201
  DirtyTreeMap,
201
202
  DirtyTreeStatus,
@@ -208,6 +209,7 @@ export {
208
209
  FormatValidator,
209
210
  FormatValidatorBasic,
210
211
  FormatValidatorNoOp,
212
+ FormatVersion,
211
213
  HandleConverter,
212
214
  ICodecOptions,
213
215
  ITreeAlpha,
@@ -234,10 +236,12 @@ export {
234
236
  JsonSchemaType,
235
237
  JsonStringKeyPatternProperties,
236
238
  JsonTreeSchema,
239
+ LocalChangeMetadata,
237
240
  MapNodeCustomizableSchema,
238
241
  MapNodeCustomizableSchemaUnsafe,
239
242
  MapNodePojoEmulationSchema,
240
243
  MapNodeSchema,
244
+ NoChangeConstraint,
241
245
  NodeSchemaOptionsAlpha,
242
246
  ObjectNodeSchema,
243
247
  ObjectSchemaOptionsAlpha,
@@ -247,9 +251,11 @@ export {
247
251
  RecordNodeCustomizableSchema,
248
252
  RecordNodePojoEmulationSchema,
249
253
  RecordNodeSchema,
254
+ RemoteChangeMetadata,
250
255
  RevertibleAlpha,
251
256
  RevertibleAlphaFactory,
252
257
  RunTransactionParams,
258
+ SchemaCompatibilitySnapshotsOptions,
253
259
  SchemaFactoryAlpha,
254
260
  SchemaType,
255
261
  SharedTreeFormatOptions,
@@ -266,9 +272,11 @@ export {
266
272
  SimpleRecordNodeSchema,
267
273
  SimpleTreeIndex,
268
274
  SimpleTreeSchema,
275
+ SnapshotFileSystem,
269
276
  System_TableSchema,
270
277
  TableSchema,
271
278
  TransactionCallbackStatus,
279
+ TransactionConstraintAlpha,
272
280
  TransactionResult,
273
281
  TransactionResultExt,
274
282
  TransactionResultFailed,
@@ -297,6 +305,7 @@ export {
297
305
  asAlpha,
298
306
  asTreeViewAlpha,
299
307
  checkCompatibility,
308
+ checkSchemaCompatibilitySnapshots,
300
309
  cloneWithReplacements,
301
310
  comparePersistedSchema,
302
311
  configuredSharedTree,
package/eslint.config.mts CHANGED
@@ -1,8 +1,8 @@
1
- /* eslint-disable */
2
- /**
3
- * GENERATED FILE - DO NOT EDIT DIRECTLY.
4
- * To regenerate: pnpm tsx scripts/generate-flat-eslint-configs.ts --typescript
1
+ /*!
2
+ * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
+ * Licensed under the MIT License.
5
4
  */
5
+
6
6
  import type { Linter } from "eslint";
7
7
  import { strict } from "../../../common/build/eslint-config-fluid/flat.mts";
8
8
 
package/lib/alpha.d.ts CHANGED
@@ -196,6 +196,7 @@ export {
196
196
  ArrayNodeSchema,
197
197
  BranchableTree,
198
198
  ChangeMetadata,
199
+ CodecName,
199
200
  CodecWriteOptions,
200
201
  DirtyTreeMap,
201
202
  DirtyTreeStatus,
@@ -208,6 +209,7 @@ export {
208
209
  FormatValidator,
209
210
  FormatValidatorBasic,
210
211
  FormatValidatorNoOp,
212
+ FormatVersion,
211
213
  HandleConverter,
212
214
  ICodecOptions,
213
215
  ITreeAlpha,
@@ -234,10 +236,12 @@ export {
234
236
  JsonSchemaType,
235
237
  JsonStringKeyPatternProperties,
236
238
  JsonTreeSchema,
239
+ LocalChangeMetadata,
237
240
  MapNodeCustomizableSchema,
238
241
  MapNodeCustomizableSchemaUnsafe,
239
242
  MapNodePojoEmulationSchema,
240
243
  MapNodeSchema,
244
+ NoChangeConstraint,
241
245
  NodeSchemaOptionsAlpha,
242
246
  ObjectNodeSchema,
243
247
  ObjectSchemaOptionsAlpha,
@@ -247,9 +251,11 @@ export {
247
251
  RecordNodeCustomizableSchema,
248
252
  RecordNodePojoEmulationSchema,
249
253
  RecordNodeSchema,
254
+ RemoteChangeMetadata,
250
255
  RevertibleAlpha,
251
256
  RevertibleAlphaFactory,
252
257
  RunTransactionParams,
258
+ SchemaCompatibilitySnapshotsOptions,
253
259
  SchemaFactoryAlpha,
254
260
  SchemaType,
255
261
  SharedTreeFormatOptions,
@@ -266,9 +272,11 @@ export {
266
272
  SimpleRecordNodeSchema,
267
273
  SimpleTreeIndex,
268
274
  SimpleTreeSchema,
275
+ SnapshotFileSystem,
269
276
  System_TableSchema,
270
277
  TableSchema,
271
278
  TransactionCallbackStatus,
279
+ TransactionConstraintAlpha,
272
280
  TransactionResult,
273
281
  TransactionResultExt,
274
282
  TransactionResultFailed,
@@ -297,6 +305,7 @@ export {
297
305
  asAlpha,
298
306
  asTreeViewAlpha,
299
307
  checkCompatibility,
308
+ checkSchemaCompatibilitySnapshots,
300
309
  cloneWithReplacements,
301
310
  comparePersistedSchema,
302
311
  configuredSharedTree,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-framework",
3
- "version": "2.74.0",
3
+ "version": "2.81.0-374083",
4
4
  "description": "The main entry point into Fluid Framework public packages",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,32 +57,32 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/container-definitions": "~2.74.0",
61
- "@fluidframework/container-loader": "~2.74.0",
62
- "@fluidframework/core-interfaces": "~2.74.0",
63
- "@fluidframework/core-utils": "~2.74.0",
64
- "@fluidframework/driver-definitions": "~2.74.0",
65
- "@fluidframework/fluid-static": "~2.74.0",
66
- "@fluidframework/map": "~2.74.0",
67
- "@fluidframework/runtime-utils": "~2.74.0",
68
- "@fluidframework/sequence": "~2.74.0",
69
- "@fluidframework/shared-object-base": "~2.74.0",
70
- "@fluidframework/tree": "~2.74.0"
60
+ "@fluidframework/container-definitions": "2.81.0-374083",
61
+ "@fluidframework/container-loader": "2.81.0-374083",
62
+ "@fluidframework/core-interfaces": "2.81.0-374083",
63
+ "@fluidframework/core-utils": "2.81.0-374083",
64
+ "@fluidframework/driver-definitions": "2.81.0-374083",
65
+ "@fluidframework/fluid-static": "2.81.0-374083",
66
+ "@fluidframework/map": "2.81.0-374083",
67
+ "@fluidframework/runtime-utils": "2.81.0-374083",
68
+ "@fluidframework/sequence": "2.81.0-374083",
69
+ "@fluidframework/shared-object-base": "2.81.0-374083",
70
+ "@fluidframework/tree": "2.81.0-374083"
71
71
  },
72
72
  "devDependencies": {
73
- "@arethetypeswrong/cli": "^0.17.1",
73
+ "@arethetypeswrong/cli": "^0.18.2",
74
74
  "@biomejs/biome": "~1.9.3",
75
- "@fluid-tools/build-cli": "^0.61.0",
75
+ "@fluid-tools/build-cli": "^0.63.0",
76
76
  "@fluidframework/build-common": "^2.0.3",
77
- "@fluidframework/build-tools": "^0.61.0",
78
- "@fluidframework/eslint-config-fluid": "~2.74.0",
77
+ "@fluidframework/build-tools": "^0.63.0",
78
+ "@fluidframework/eslint-config-fluid": "2.81.0-374083",
79
79
  "@microsoft/api-extractor": "7.52.11",
80
80
  "@types/node": "^18.19.0",
81
- "concurrently": "^8.2.1",
81
+ "concurrently": "^9.2.1",
82
82
  "copyfiles": "^2.4.1",
83
- "eslint": "~8.57.1",
83
+ "eslint": "~9.39.1",
84
84
  "jiti": "^2.6.1",
85
- "rimraf": "^4.4.0",
85
+ "rimraf": "^6.1.2",
86
86
  "typescript": "~5.4.5"
87
87
  },
88
88
  "fluidBuild": {
package/.eslintrc.cjs DELETED
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- module.exports = {
7
- extends: ["@fluidframework/eslint-config-fluid/strict", "prettier"],
8
- parserOptions: {
9
- project: ["./tsconfig.json"],
10
- },
11
- rules: {},
12
- };