fluid-framework 2.103.0 → 2.110.0

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,66 @@
1
1
  # fluid-framework
2
2
 
3
+ ## 2.110.0
4
+
5
+ ### Minor Changes
6
+
7
+ - TreeBranchAlpha.isMissingEditsFrom ([#27583](https://github.com/microsoft/FluidFramework/pull/27583)) [ef92f1f1cd8](https://github.com/microsoft/FluidFramework/commit/ef92f1f1cd880ed361e9f8efa49fb23c4ee64ca3)
8
+
9
+ Adds a new method (`isMissingEditsFrom(branch: TreeBranch): boolean`) to `TreeBranchAlpha`.
10
+ `isMissingEditsFrom` can be used to determine whether there are edits on the given `branch` that have not yet been merged into this branch.
11
+
12
+ - Forks created on "changed" event are no longer auto-disposed ([#27580](https://github.com/microsoft/FluidFramework/pull/27580)) [ae64be7688e](https://github.com/microsoft/FluidFramework/commit/ae64be7688e26da9bfc5c0286e50d3df0647ff3a)
13
+
14
+ The "changed" event is emitted from a `TreeBranch` when a change is made to the branch.
15
+ Previously, when this event was fired due to a transaction being committed, it was possible to fork the branch in response to the "changed" event, but such a fork would be automatically disposed immediately after the event callback.
16
+ This was a bug. Such forks are no longer disposed automatically.
17
+
18
+ - Editing a SharedTree during its change-event callbacks now consistently throws ([#27285](https://github.com/microsoft/FluidFramework/pull/27285)) [255d4505ed5](https://github.com/microsoft/FluidFramework/commit/255d4505ed574676735c6f2078199e5b29dede2a)
19
+
20
+ Editing a `SharedTree` from inside one of its change-event callbacks has always been forbidden, but some paths were not being caught: edits and the start of a transaction (along with branch operations, reverts, etc.) made while the tree was emitting its post-change notification ran to completion instead of throwing.
21
+
22
+ Such edits would apply to the tree, trigger further change notifications, and could re-enter the same listener for the resulting commits.
23
+ This can produce infinite edit loops, redundant work across clients, incorrect attribution, broken undo/redo grouping, and pollution of the outer commit's label data.
24
+
25
+ This release closes those gaps: both editing the tree and starting a transaction during a change-event callback now throw the same canonical `UsageError` as the other change-event callbacks:
26
+
27
+ > Editing the tree is forbidden during a change event callback
28
+
29
+ > Running a transaction is forbidden during a change event callback
30
+
31
+ More generally, edits should not be made in response to changes to the document.
32
+ See [Editing in response to change events](https://fluidframework.com/docs/data-structures/tree/events#editing-in-response-to-change-events) for why, and for the recommended alternatives.
33
+
34
+ - TableSchema (beta) methods now accept positional arguments ([#27545](https://github.com/microsoft/FluidFramework/pull/27545)) [e121ff71f3e](https://github.com/microsoft/FluidFramework/commit/e121ff71f3ebed80c656315486933fe2d6859b32)
35
+
36
+ The `insertColumns`, `insertRows`, `setCell`, and `removeCell` methods on `TableSchema.Table` now accept positional arguments in addition to the existing property-bag form.
37
+ The new overloads remove a layer of object construction at call sites and make the common cases more concise.
38
+
39
+ The existing property-bag overloads continue to work but are now deprecated.
40
+ They will be removed in a future release.
41
+
42
+ #### Migration
43
+
44
+ ```typescript
45
+ // ...
46
+
47
+ // Before
48
+ table.insertColumns({ columns: [columnA, columnB] });
49
+ table.insertColumns({ index: 0, columns: [columnA] });
50
+ table.insertRows({ rows: [rowA, rowB] });
51
+ table.insertRows({ index: 0, rows: [rowA] });
52
+ table.setCell({ key: { column, row }, cell });
53
+ table.removeCell({ column, row });
54
+
55
+ // After
56
+ table.insertColumns([columnA, columnB]);
57
+ table.insertColumns([columnA], 0);
58
+ table.insertRows([rowA, rowB]);
59
+ table.insertRows([rowA], 0);
60
+ table.setCell(row, column, cell);
61
+ table.removeCell(row, column);
62
+ ```
63
+
3
64
  ## 2.103.0
4
65
 
5
66
  Dependency updates only.
@@ -1942,12 +1942,12 @@ export namespace TableSchema {
1942
1942
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1943
1943
  readonly props: TProps;
1944
1944
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
1945
- // @input
1945
+ // @deprecated @input
1946
1946
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1947
1947
  readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
1948
1948
  readonly index?: number | undefined;
1949
1949
  }
1950
- // @input
1950
+ // @deprecated @input
1951
1951
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1952
1952
  readonly index?: number | undefined;
1953
1953
  readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
@@ -1962,7 +1962,7 @@ export namespace TableSchema {
1962
1962
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1963
1963
  readonly props: TProps;
1964
1964
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
1965
- // @input
1965
+ // @deprecated @input
1966
1966
  export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
1967
1967
  readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
1968
1968
  readonly key: CellKey<TColumn, TRow>;
@@ -1975,8 +1975,14 @@ export namespace TableSchema {
1975
1975
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
1976
1976
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1977
1977
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1978
+ insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1979
+ // @deprecated
1978
1980
  insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1981
+ insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
1982
+ // @deprecated
1979
1983
  insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
1984
+ removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1985
+ // @deprecated
1980
1986
  removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1981
1987
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1982
1988
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -1985,6 +1991,8 @@ export namespace TableSchema {
1985
1991
  removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1986
1992
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1987
1993
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
1994
+ setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
1995
+ // @deprecated
1988
1996
  setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
1989
1997
  }
1990
1998
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
@@ -2194,6 +2202,7 @@ export interface TreeBranchAlpha extends TreeBranch, TreeContextAlpha {
2194
2202
  // (undocumented)
2195
2203
  fork(): TreeBranchAlpha;
2196
2204
  hasRootSchema<TSchema extends ImplicitFieldSchema>(schema: TSchema): this is TreeViewAlpha<TSchema>;
2205
+ isMissingEditsFrom(branch: TreeBranch): boolean;
2197
2206
  runTransaction<TSuccessValue, TFailureValue>(transaction: () => TransactionCallbackStatus<TSuccessValue, TFailureValue>, params?: RunTransactionParams): TransactionResultExt<TSuccessValue, TFailureValue>;
2198
2207
  runTransaction(transaction: () => VoidTransactionCallbackStatus | void, params?: RunTransactionParams): TransactionResult;
2199
2208
  runTransactionAsync<TSuccessValue, TFailureValue>(transaction: () => Promise<TransactionCallbackStatus<TSuccessValue, TFailureValue>>, params?: RunTransactionParams): Promise<TransactionResultExt<TSuccessValue, TFailureValue>>;
@@ -1219,12 +1219,12 @@ export namespace TableSchema {
1219
1219
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1220
1220
  readonly props: TProps;
1221
1221
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
1222
- // @input
1222
+ // @deprecated @input
1223
1223
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1224
1224
  readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
1225
1225
  readonly index?: number | undefined;
1226
1226
  }
1227
- // @input
1227
+ // @deprecated @input
1228
1228
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1229
1229
  readonly index?: number | undefined;
1230
1230
  readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
@@ -1239,7 +1239,7 @@ export namespace TableSchema {
1239
1239
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1240
1240
  readonly props: TProps;
1241
1241
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
1242
- // @input
1242
+ // @deprecated @input
1243
1243
  export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
1244
1244
  readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
1245
1245
  readonly key: CellKey<TColumn, TRow>;
@@ -1252,8 +1252,14 @@ export namespace TableSchema {
1252
1252
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
1253
1253
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1254
1254
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1255
+ insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1256
+ // @deprecated
1255
1257
  insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1258
+ insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
1259
+ // @deprecated
1256
1260
  insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
1261
+ removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1262
+ // @deprecated
1257
1263
  removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1258
1264
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1259
1265
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -1262,6 +1268,8 @@ export namespace TableSchema {
1262
1268
  removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1263
1269
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1264
1270
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
1271
+ setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
1272
+ // @deprecated
1265
1273
  setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
1266
1274
  }
1267
1275
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
@@ -1585,12 +1585,12 @@ export namespace TableSchema {
1585
1585
  export function column<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateColumnOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1586
1586
  readonly props: TProps;
1587
1587
  }): System_TableSchema.ColumnSchemaBase<TUserScope, TCell, TProps>;
1588
- // @input
1588
+ // @deprecated @input
1589
1589
  export interface InsertColumnsParameters<TColumn extends ImplicitAllowedTypes> {
1590
1590
  readonly columns: InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[];
1591
1591
  readonly index?: number | undefined;
1592
1592
  }
1593
- // @input
1593
+ // @deprecated @input
1594
1594
  export interface InsertRowsParameters<TRow extends ImplicitAllowedTypes> {
1595
1595
  readonly index?: number | undefined;
1596
1596
  readonly rows: InsertableTreeNodeFromImplicitAllowedTypes<TRow>[];
@@ -1605,7 +1605,7 @@ export namespace TableSchema {
1605
1605
  export function row<const TUserScope extends string, const TCell extends ImplicitAllowedTypes, const TProps extends ImplicitFieldSchema>(params: System_TableSchema.CreateRowOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell> & {
1606
1606
  readonly props: TProps;
1607
1607
  }): System_TableSchema.RowSchemaBase<TUserScope, TCell, TProps>;
1608
- // @input
1608
+ // @deprecated @input
1609
1609
  export interface SetCellParameters<TCell extends ImplicitAllowedTypes, TColumn extends ImplicitAllowedTypes, TRow extends ImplicitAllowedTypes> {
1610
1610
  readonly cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>;
1611
1611
  readonly key: CellKey<TColumn, TRow>;
@@ -1618,8 +1618,14 @@ export namespace TableSchema {
1618
1618
  getColumn(index: number): TreeNodeFromImplicitAllowedTypes<TColumn> | undefined;
1619
1619
  getRow(id: string): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1620
1620
  getRow(index: number): TreeNodeFromImplicitAllowedTypes<TRow> | undefined;
1621
+ insertColumns(columns: readonly InsertableTreeNodeFromImplicitAllowedTypes<TColumn>[], index?: number): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1622
+ // @deprecated
1621
1623
  insertColumns(params: InsertColumnsParameters<TColumn>): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1624
+ insertRows(rows: readonly InsertableTreeNodeFromImplicitAllowedTypes<TRow>[], index?: number): TreeNodeFromImplicitAllowedTypes<TRow>[];
1625
+ // @deprecated
1622
1626
  insertRows(params: InsertRowsParameters<TRow>): TreeNodeFromImplicitAllowedTypes<TRow>[];
1627
+ removeCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1628
+ // @deprecated
1623
1629
  removeCell(key: CellKey<TColumn, TRow>): TreeNodeFromImplicitAllowedTypes<TCell> | undefined;
1624
1630
  removeColumns(index?: number | undefined, count?: number | undefined): TreeNodeFromImplicitAllowedTypes<TColumn>[];
1625
1631
  removeColumns(columns: readonly TreeNodeFromImplicitAllowedTypes<TColumn>[]): TreeNodeFromImplicitAllowedTypes<TColumn>[];
@@ -1628,6 +1634,8 @@ export namespace TableSchema {
1628
1634
  removeRows(rows: readonly TreeNodeFromImplicitAllowedTypes<TRow>[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1629
1635
  removeRows(rows: readonly string[]): TreeNodeFromImplicitAllowedTypes<TRow>[];
1630
1636
  readonly rows: System_TableSchema.RearrangeableList<TRow>;
1637
+ setCell(row: string | number | TreeNodeFromImplicitAllowedTypes<TRow>, column: string | number | TreeNodeFromImplicitAllowedTypes<TColumn>, cell: InsertableTreeNodeFromImplicitAllowedTypes<TCell>): void;
1638
+ // @deprecated
1631
1639
  setCell(params: SetCellParameters<TCell, TColumn, TRow>): void;
1632
1640
  }
1633
1641
  export function table<const TUserScope extends string, const TCell extends ImplicitAllowedTypes>(params: System_TableSchema.TableFactoryOptionsBase<TUserScope, SchemaFactoryBeta<TUserScope>, TCell>): System_TableSchema.TableSchemaBase<TUserScope, TCell, System_TableSchema.ColumnSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>, System_TableSchema.RowSchemaBase<TUserScope, TCell, System_TableSchema.DefaultPropsType>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluid-framework",
3
- "version": "2.103.0",
3
+ "version": "2.110.0",
4
4
  "description": "The main entry point into Fluid Framework public packages",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": {
@@ -57,17 +57,17 @@
57
57
  "main": "lib/index.js",
58
58
  "types": "lib/public.d.ts",
59
59
  "dependencies": {
60
- "@fluidframework/container-definitions": "~2.103.0",
61
- "@fluidframework/container-loader": "~2.103.0",
62
- "@fluidframework/core-interfaces": "~2.103.0",
63
- "@fluidframework/core-utils": "~2.103.0",
64
- "@fluidframework/driver-definitions": "~2.103.0",
65
- "@fluidframework/fluid-static": "~2.103.0",
66
- "@fluidframework/map": "~2.103.0",
67
- "@fluidframework/runtime-utils": "~2.103.0",
68
- "@fluidframework/sequence": "~2.103.0",
69
- "@fluidframework/shared-object-base": "~2.103.0",
70
- "@fluidframework/tree": "~2.103.0"
60
+ "@fluidframework/container-definitions": "~2.110.0",
61
+ "@fluidframework/container-loader": "~2.110.0",
62
+ "@fluidframework/core-interfaces": "~2.110.0",
63
+ "@fluidframework/core-utils": "~2.110.0",
64
+ "@fluidframework/driver-definitions": "~2.110.0",
65
+ "@fluidframework/fluid-static": "~2.110.0",
66
+ "@fluidframework/map": "~2.110.0",
67
+ "@fluidframework/runtime-utils": "~2.110.0",
68
+ "@fluidframework/sequence": "~2.110.0",
69
+ "@fluidframework/shared-object-base": "~2.110.0",
70
+ "@fluidframework/tree": "~2.110.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@arethetypeswrong/cli": "^0.18.2",
@@ -75,13 +75,13 @@
75
75
  "@fluid-tools/build-cli": "^0.65.0",
76
76
  "@fluidframework/build-common": "^2.0.3",
77
77
  "@fluidframework/build-tools": "^0.65.0",
78
- "@fluidframework/eslint-config-fluid": "^9.0.0",
78
+ "@fluidframework/eslint-config-fluid": "^13.0.0",
79
79
  "@microsoft/api-extractor": "7.58.1",
80
80
  "@types/node": "~22.19.17",
81
81
  "concurrently": "^9.2.1",
82
82
  "copyfiles": "^2.4.1",
83
83
  "eslint": "~9.39.1",
84
- "fluid-framework-previous": "npm:fluid-framework@2.101.0",
84
+ "fluid-framework-previous": "npm:fluid-framework@2.103.0",
85
85
  "jiti": "^2.6.1",
86
86
  "rimraf": "^6.1.3",
87
87
  "typescript": "~5.4.5"