fluid-framework 2.41.0-338401 → 2.42.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 +369 -0
- package/api-report/fluid-framework.alpha.api.md +21 -7
- package/dist/alpha.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/lib/alpha.d.ts +2 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/package.json +13 -13
- package/src/index.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,374 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.42.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Fix Tree.key and Tree.parent for Unhydrated nodes after edits ([#24708](https://github.com/microsoft/FluidFramework/pull/24708)) [8aa5c233e2](https://github.com/microsoft/FluidFramework/commit/8aa5c233e2d59f440fd9c923bca14687bb958d66)
|
|
8
|
+
|
|
9
|
+
In some cases, editing [Unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) nodes could result in incorrect results being returned from [Tree.key](https://fluidframework.com/docs/data-structures/tree/nodes#treekey) and [Tree.parent](https://fluidframework.com/docs/data-structures/tree/nodes#treeparent).
|
|
10
|
+
This has been fixed.
|
|
11
|
+
|
|
12
|
+
- Defaulted identifier fields on unhydrated nodes are now enumerable ([#24739](https://github.com/microsoft/FluidFramework/pull/24739)) [3a5d0acfb6](https://github.com/microsoft/FluidFramework/commit/3a5d0acfb65f93a927405241e6047c8a04c8da58)
|
|
13
|
+
|
|
14
|
+
Previously, there was a special case for defaulted [identifier](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class#identifier-property) fields on unhydrated nodes where they were not enumerable.
|
|
15
|
+
This special case has been removed: they are now enumerable independent of hydration status and defaulting.
|
|
16
|
+
|
|
17
|
+
- Name collisions from structurally named schema now error ([#24707](https://github.com/microsoft/FluidFramework/pull/24707)) [a343f0498f](https://github.com/microsoft/FluidFramework/commit/a343f0498f2039e68aa11e8ede98f32391ce727d)
|
|
18
|
+
|
|
19
|
+
It is legal to have multiple [TreeNodeSchema](https://fluidframework.com/docs/api/fluid-framework/treenodeschema-typealias) with the same name so long as they are not used together in the same tree.
|
|
20
|
+
Using different schema with the same name when building otherwise identical [structurally named](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class#schemafactory-remarks) in the same [SchemaFactory](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class) is not valid, however.
|
|
21
|
+
Previously doing this would not error, and instead return the first structurally named schema with that name.
|
|
22
|
+
Now this case throws an informative error:
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
const factory = new SchemaFactory(undefined);
|
|
26
|
+
class Child1 extends factory.object("Child", {}) {}
|
|
27
|
+
class Child2 extends factory.object("Child", {}) {}
|
|
28
|
+
|
|
29
|
+
const a = factory.map(Child1);
|
|
30
|
+
|
|
31
|
+
// Throws a UsageError with the message:
|
|
32
|
+
// "Structurally named schema collision: two schema named "Array<["Child"]>" were defined with different input schema."
|
|
33
|
+
const b = factory.array(Child2);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## 2.41.0
|
|
37
|
+
|
|
38
|
+
### Minor Changes
|
|
39
|
+
|
|
40
|
+
- TreeAlpha.create now accepts unhydrated nodes ([#24629](https://github.com/microsoft/FluidFramework/pull/24629)) [e63af87aeb](https://github.com/microsoft/FluidFramework/commit/e63af87aeb7ece1ff0969027904c3b18f122d2d1)
|
|
41
|
+
|
|
42
|
+
[TreeAlpha.create](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#create-methodsignature) now accepts [unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) nodes.
|
|
43
|
+
`TreeAlpha.create`'s documentation has been updated to clarify that this is supported.
|
|
44
|
+
|
|
45
|
+
Additionally `TreeAlpha.create` no longer throws a "Tree does not conform to schema" error when given a tree omitting an identifier.
|
|
46
|
+
Instead, the identifier behaves like it would for other ways to build unhydrated nodes: remaining unreadable until hydrated.
|
|
47
|
+
|
|
48
|
+
- SharedTrees's FluidClientVersion enum (alpha) has been redesigned ([#24638](https://github.com/microsoft/FluidFramework/pull/24638)) [5f3b9d7b7d](https://github.com/microsoft/FluidFramework/commit/5f3b9d7b7d12307d89cbd4b88f5e2d6e1833680d)
|
|
49
|
+
|
|
50
|
+
Users of [FluidClientVersion](https://fluidframework.com/docs/api/fluid-framework/fluidclientversion-enum)'s `v2_1`, `v2_2`, and `v2_3` entries should specify `v2_0` instead.
|
|
51
|
+
This will result in no functional differences since no code currently opts into any additional functionality based on specifying those versions.
|
|
52
|
+
The new approach avoids listing versions which there is currently no reason to select, and thus these options have been removed.
|
|
53
|
+
If future work adds support to opt into features which only work starting with some of those versions, they will be re-added at that time.
|
|
54
|
+
|
|
55
|
+
- ForestTypeExpensiveDebug now validates content against schema ([#24658](https://github.com/microsoft/FluidFramework/pull/24658)) [9d600aae88](https://github.com/microsoft/FluidFramework/commit/9d600aae88b9045392067719638258ea7407c2eb)
|
|
56
|
+
|
|
57
|
+
When opting into using [ForestTypeExpensiveDebug](https://fluidframework.com/docs/api/fluid-framework/#foresttypeexpensivedebug-variable) using [configuredSharedTree](https://fluidframework.com/docs/api/fluid-framework/#configuredsharedtree-function), the tree is now checked against the schema on load and after every edit.
|
|
58
|
+
This should help detect and diagnose document corruption bugs.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
const DebugSharedTree = configuredSharedTree({
|
|
62
|
+
jsonValidator: typeboxValidator,
|
|
63
|
+
// Now detects corrupted documents which are out of schema.
|
|
64
|
+
forest: ForestTypeExpensiveDebug,
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
- The comparePersistedSchema function (alpha) has had its canInitialize parameter removed ([#24606](https://github.com/microsoft/FluidFramework/pull/24606)) [d083a1780a](https://github.com/microsoft/FluidFramework/commit/d083a1780a1db74a922cbfb451d23ab932c0eb32)
|
|
69
|
+
|
|
70
|
+
[comparePersistedSchema](https://fluidframework.com/docs/api/tree/#comparepersistedschema-function) has had its `canInitialize` parameter removed.
|
|
71
|
+
This parameter was only used to add to the output [SchemaCompatibilityStatus](https://fluidframework.com/docs/api/fluid-framework/schemacompatibilitystatus-interface).
|
|
72
|
+
If a full `SchemaCompatibilityStatus` is still desired, the `canInitialize` value can be added to the result:
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
// old
|
|
76
|
+
const result = comparePersistedSchema(a, b, canInitialize);
|
|
77
|
+
// new
|
|
78
|
+
const result = { ...comparePersistedSchema(a, b), canInitialize };
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
- TreeNodes now implicitly generate identifiers on access instead of throwing ([#24665](https://github.com/microsoft/FluidFramework/pull/24665)) [cd5976b959](https://github.com/microsoft/FluidFramework/commit/cd5976b959d6b7a5259e3bb9ef816f842724bc6e)
|
|
82
|
+
|
|
83
|
+
Accessing a defaulted [identifier](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class#identifier-property) on an [Unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) `TreeNode` no longer throws a usage error.
|
|
84
|
+
Instead, a new UUID is allocated for the identifier and returned.
|
|
85
|
+
These UUIDs will be more compressible than random ones, since they all come from a single sequence (starting with a random UUID).
|
|
86
|
+
They will not be fully compressed like the identifiers generated after hydration that leverage the document's [IIdCompressor](https://fluidframework.com/docs/api/id-compressor/iidcompressor-interface).
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
const factory = new SchemaFactory("test");
|
|
90
|
+
class HasIdentifier extends schema.object("A", { id: factory.identifier }) {}
|
|
91
|
+
// This used to throw an error:
|
|
92
|
+
const id = new HasIdentifier({}).id;
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
- New TableSchema (alpha) APIs ([#24579](https://github.com/microsoft/FluidFramework/pull/24579)) [e565f6838b](https://github.com/microsoft/FluidFramework/commit/e565f6838b31d3e777da942c806606575123f6d6)
|
|
96
|
+
|
|
97
|
+
A `TableSchema` utility has been added to Shared Tree for managing dynamic, tabular data.
|
|
98
|
+
This new `TableSchema` namespace contains APIs for creating column, row, and table [node schema](https://fluidframework.com/docs/api/fluid-framework/treenodeschema-typealias).
|
|
99
|
+
|
|
100
|
+
Note: these APIs require the use of [SchemaFactoryAlpha](https://fluidframework.com/docs/api/fluid-framework/schemafactoryalpha-class).
|
|
101
|
+
|
|
102
|
+
> [!WARNING]
|
|
103
|
+
> These APIs are in preview and are subject to change.
|
|
104
|
+
> Until these APIs have stabilized, it is not recommended to use them in production code.
|
|
105
|
+
> There may be breaking changes to these APIs and their underlying data format.
|
|
106
|
+
> Using these APIs in production code may result in data loss or corruption.
|
|
107
|
+
|
|
108
|
+
#### Creating a table
|
|
109
|
+
|
|
110
|
+
You can craft a table schema with `TableSchema.table`.
|
|
111
|
+
This includes providing a schema for the cells that will appear in the table:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
class MyTable extends TableSchema.table({
|
|
115
|
+
schemaFactory,
|
|
116
|
+
cell: schemaFactory.string,
|
|
117
|
+
}) {}
|
|
118
|
+
|
|
119
|
+
const table = new MyTable({
|
|
120
|
+
columns: [{ id: "column-0" }],
|
|
121
|
+
rows: [{ id: "row-0", cells: { "column-0": "Hello world!" } }],
|
|
122
|
+
});
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### Creating a table with custom column and row schema
|
|
126
|
+
|
|
127
|
+
To associate additional data with your rows or columns, generate custom row and column schema using `TableSchema.column` and `TableSchema.row`.
|
|
128
|
+
These schema can then be provided to `TableSchema.table`:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
class MyColumn extends TableSchema.column({
|
|
132
|
+
schemaFactory,
|
|
133
|
+
cell: Cell,
|
|
134
|
+
props: schemaFactory.object("TableColumnProps", {
|
|
135
|
+
label: schemaFactory.string,
|
|
136
|
+
}),
|
|
137
|
+
}) {}
|
|
138
|
+
|
|
139
|
+
class MyRow extends TableSchema.row({
|
|
140
|
+
schemaFactory,
|
|
141
|
+
cell: Cell,
|
|
142
|
+
}) {}
|
|
143
|
+
|
|
144
|
+
class MyTable extends TableSchema.table({
|
|
145
|
+
schemaFactory,
|
|
146
|
+
cell: Cell,
|
|
147
|
+
column: MyColumn,
|
|
148
|
+
row: MyRow,
|
|
149
|
+
}) {}
|
|
150
|
+
|
|
151
|
+
const table = new MyTable({
|
|
152
|
+
columns: [
|
|
153
|
+
new MyColumn({ props: { label: "Entry" } }),
|
|
154
|
+
new MyColumn({ props: { label: "Date" } }),
|
|
155
|
+
new MyColumn({ props: { label: "Amount" } }),
|
|
156
|
+
],
|
|
157
|
+
rows: [],
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### Interacting with the table
|
|
162
|
+
|
|
163
|
+
Table trees created using `TableSchema` offer various APIs to make working with tabular data easy.
|
|
164
|
+
These include:
|
|
165
|
+
|
|
166
|
+
- Insertion and removal of columns, rows, and cells.
|
|
167
|
+
- Cell access by column/row.
|
|
168
|
+
|
|
169
|
+
```typescript
|
|
170
|
+
// Create an empty table
|
|
171
|
+
const table = MyTable.empty();
|
|
172
|
+
|
|
173
|
+
const column0 = new MyColumn({
|
|
174
|
+
props: { label: "Column 0" },
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// Append a column to the end of the table.
|
|
178
|
+
table.insertColumn({
|
|
179
|
+
column: column0,
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
const rows = [new MyRow({ cells: {} }), new MyRow({ cells: {} })];
|
|
183
|
+
|
|
184
|
+
// Insert rows at the beginning of the table.
|
|
185
|
+
table.insertRows({
|
|
186
|
+
index: 0,
|
|
187
|
+
rows,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
// Set cell at row 0, column 0.
|
|
191
|
+
table.setCell({
|
|
192
|
+
key: {
|
|
193
|
+
column: column0,
|
|
194
|
+
row: rows[0],
|
|
195
|
+
},
|
|
196
|
+
cell: "Hello",
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
// Set cell at row 1, column 0.
|
|
200
|
+
table.setCell({
|
|
201
|
+
key: {
|
|
202
|
+
column: column0,
|
|
203
|
+
row: rows[1],
|
|
204
|
+
},
|
|
205
|
+
cell: "World",
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
// Remove the first row.
|
|
209
|
+
// Note: this will also remove the row's cell.
|
|
210
|
+
table.removeRow(rows[0]);
|
|
211
|
+
|
|
212
|
+
// Remove the column.
|
|
213
|
+
// Note: this will *not* remove the remaining cell under this column.
|
|
214
|
+
table.removeColumn(column0);
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
#### Listening for changes
|
|
218
|
+
|
|
219
|
+
Listening for changes to table trees behaves just like it would for any other nodes in a Shared Tree (see [here](https://fluidframework.com/docs/data-structures/tree/events) for more details).
|
|
220
|
+
|
|
221
|
+
The most straightforward option is to listen for any changes to the table node and its descendants.
|
|
222
|
+
For example:
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
class Cell extends schemaFactory.object("TableCell", {
|
|
226
|
+
value: schemaFactory.string,
|
|
227
|
+
}) {}
|
|
228
|
+
|
|
229
|
+
class Table extends TableSchema.table({
|
|
230
|
+
schemaFactory,
|
|
231
|
+
cell: Cell,
|
|
232
|
+
}) {}
|
|
233
|
+
|
|
234
|
+
const table = new Table({
|
|
235
|
+
columns: [{ id: "column-0" }],
|
|
236
|
+
rows: [{ id: "row-0", cells: {} }],
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
// Listen for any changes to the table and its children.
|
|
240
|
+
// The "treeChanged" event will fire when the `table` node or any of its descendants change.
|
|
241
|
+
Tree.on(table, "treeChanged", () => {
|
|
242
|
+
// Respond to the change.
|
|
243
|
+
});
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
If you need more granular eventing to meet your performance needs, that is possible as well.
|
|
247
|
+
For example, if you wish to know when the table's list of rows changes, you could do the following:
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
class Cell extends schemaFactory.object("TableCell", {
|
|
251
|
+
value: schemaFactory.string,
|
|
252
|
+
}) {}
|
|
253
|
+
|
|
254
|
+
class Table extends TableSchema.table({
|
|
255
|
+
schemaFactory,
|
|
256
|
+
cell: Cell,
|
|
257
|
+
}) {}
|
|
258
|
+
|
|
259
|
+
const table = new Table({
|
|
260
|
+
columns: [{ id: "column-0" }],
|
|
261
|
+
rows: [{ id: "row-0", cells: {} }],
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
// Listen for any changes to the list of rows.
|
|
265
|
+
// The "nodeChanged" event will fire only when the `rows` node itself changes (i.e., its own properties change).
|
|
266
|
+
// In this case, the event will fire when a row is added or removed, or the order of the list is changed.
|
|
267
|
+
// But it won't fire when a row's properties change, or when the row's cells change, etc.
|
|
268
|
+
Tree.on(table.rows, "nodeChanged", () => {
|
|
269
|
+
// Respond to the change.
|
|
270
|
+
});
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### Limitations
|
|
274
|
+
|
|
275
|
+
##### Orphaned cells
|
|
276
|
+
|
|
277
|
+
Cells in the table may become "orphaned."
|
|
278
|
+
That is, it is possible to enter a state where one or more rows contain cells with no corresponding column.
|
|
279
|
+
To reduce the likelihood of this, you can manually remove corresponding cells when removing columns.
|
|
280
|
+
|
|
281
|
+
For example:
|
|
282
|
+
|
|
283
|
+
```typescript
|
|
284
|
+
// Remove column1 and all of its cells.
|
|
285
|
+
// The "transaction" method will ensure that all changes are applied atomically.
|
|
286
|
+
Tree.runTransaction(table, () => {
|
|
287
|
+
// Remove column1
|
|
288
|
+
table.removeColumn(column1);
|
|
289
|
+
|
|
290
|
+
// Remove the cell at column1 for each row.
|
|
291
|
+
for (const row of table.rows) {
|
|
292
|
+
table.removeCell({
|
|
293
|
+
column: column1,
|
|
294
|
+
row,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
> [!WARNING]
|
|
301
|
+
> Note that even with the above precaution, it is possible to enter such an orphaned cell state via the merging of edits.
|
|
302
|
+
> For example: one client might add a row while another concurrently removes a column, orphaning the cell where the column and row intersected.
|
|
303
|
+
|
|
304
|
+
- New TreeAlpha identifier APIs for converting, retrieving, and generating identifiers ([#24218](https://github.com/microsoft/FluidFramework/pull/24218)) [e5b2882132](https://github.com/microsoft/FluidFramework/commit/e5b28821323566112096f05805281b8d5321077d)
|
|
305
|
+
|
|
306
|
+
#### TreeAlpha.identifier
|
|
307
|
+
|
|
308
|
+
You can retrieve the long identifier with `TreeAlpha.identifier(node)`, where `node` is a `TreeNode`. The long identifier is a stable, compressible UUID generated by the tree.
|
|
309
|
+
In cases where the node does not yet have an identifier assigned, this will return `undefined`.
|
|
310
|
+
These cases include:
|
|
311
|
+
|
|
312
|
+
- The node does not contain an identifier field.
|
|
313
|
+
- The node is a non-hydrated node with a user provided identifier. Note that if it is a non-hydrated node without an identifier provided, it will throw an error.
|
|
314
|
+
|
|
315
|
+
#### TreeAlpha.identifier.shorten
|
|
316
|
+
|
|
317
|
+
You can shorten a long identifier with `TreeAlpha.identifier.shorten(branch, identifier)`, where `branch` is a `TreeBranch`, and `identifier` is a `string`.
|
|
318
|
+
If the method returns a valid short identifier, this identifier can be passed into `TreeAlpha.identifier.lengthen`
|
|
319
|
+
to get the original valid long `identifier` back.
|
|
320
|
+
In the cases where it's not possible to shorten the `identifier`, it will return `undefined`.
|
|
321
|
+
These cases include:
|
|
322
|
+
|
|
323
|
+
- A compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree.
|
|
324
|
+
- An identifier which is not compressible by the tree. This can occur if the node's identifier was a user provided string.
|
|
325
|
+
|
|
326
|
+
#### TreeAlpha.identifier.lengthen
|
|
327
|
+
|
|
328
|
+
You can lengthen a short identifier with `TreeAlpha.identifier.lengthen(branch, identifier)`, where `branch` is a `TreeBranch`, and `identifier` is a `number`.
|
|
329
|
+
If the method returns a valid long identifier, this identifier can be passed into `TreeAlpha.identifier.shorten` to get the original `identifier` back.
|
|
330
|
+
In the cases where it's not possible to lengthen the `identifier`, this method will throw an error.
|
|
331
|
+
These cases include:
|
|
332
|
+
|
|
333
|
+
- An unrecognized short identifier. This can occur if the identifier is not generated from the tree.
|
|
334
|
+
|
|
335
|
+
#### TreeAlpha.identifier.getShort
|
|
336
|
+
|
|
337
|
+
You can retrieve the short identifier from a node with `TreeAlpha.identifier.getShort(node)` where `node` is a `TreeNode`.
|
|
338
|
+
If it is not possible to retrieve the short identifier, it will return `undefined`
|
|
339
|
+
|
|
340
|
+
##### Example for a node with valid identifier
|
|
341
|
+
|
|
342
|
+
```typescript
|
|
343
|
+
// This will retrieve the short identifier from the node.
|
|
344
|
+
const shortIdentifier = TreeAlpha.identifier.getShort(
|
|
345
|
+
nodeWithValidIdentifier,
|
|
346
|
+
);
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
##### Examples for when you get undefined
|
|
350
|
+
|
|
351
|
+
In cases where the node provided does not contain an identifier that is recognized or compressible by the tree that the node belongs to, this method will return undefined.
|
|
352
|
+
This will occur in the following cases:
|
|
353
|
+
|
|
354
|
+
- The node is an non-hydrated node with a user provided identifier. Note that if it is an non-hydrated node without an identifier provided, it will throw an error.
|
|
355
|
+
- The node does not contain an identifier field.
|
|
356
|
+
- The node contains a compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree.
|
|
357
|
+
- The node contains an identifier which is not compressible by its id compressor. This can occur if the node's identifier was a user provided string.
|
|
358
|
+
|
|
359
|
+
```typescript
|
|
360
|
+
// This will return undefined
|
|
361
|
+
const shortIdentifier = TreeAlpha.identifier.getShort(node);
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
#### TreeAlpha.identifier.create
|
|
365
|
+
|
|
366
|
+
You can create a long identifier from a branch with `TreeAlpha.identifier.create(branch)` where `branch` is a `TreeBranch`.
|
|
367
|
+
|
|
368
|
+
```typescript
|
|
369
|
+
const createdIdentifier = TreeAlpha.identifier.create(branch);
|
|
370
|
+
```
|
|
371
|
+
|
|
3
372
|
## 2.40.0
|
|
4
373
|
|
|
5
374
|
### Minor Changes
|
|
@@ -101,6 +101,11 @@ export function cloneWithReplacements(root: unknown, rootKey: string, replacer:
|
|
|
101
101
|
value: unknown;
|
|
102
102
|
}): unknown;
|
|
103
103
|
|
|
104
|
+
// @alpha @input
|
|
105
|
+
export interface CodecWriteOptions extends ICodecOptions {
|
|
106
|
+
readonly oldestCompatibleClient: FluidClientVersion;
|
|
107
|
+
}
|
|
108
|
+
|
|
104
109
|
// @public
|
|
105
110
|
export enum CommitKind {
|
|
106
111
|
Default = 0,
|
|
@@ -326,7 +331,7 @@ export function getSimpleSchema(schema: ImplicitFieldSchema): SimpleTreeSchema;
|
|
|
326
331
|
// @alpha
|
|
327
332
|
export type HandleConverter<TCustom> = (data: IFluidHandle) => TCustom;
|
|
328
333
|
|
|
329
|
-
// @alpha
|
|
334
|
+
// @alpha @input
|
|
330
335
|
export interface ICodecOptions {
|
|
331
336
|
readonly jsonValidator: JsonValidator;
|
|
332
337
|
}
|
|
@@ -840,7 +845,7 @@ export type JsonTreeSchema = JsonFieldSchema & {
|
|
|
840
845
|
readonly $defs: Record<JsonSchemaId, JsonNodeSchema>;
|
|
841
846
|
};
|
|
842
847
|
|
|
843
|
-
// @alpha
|
|
848
|
+
// @alpha @input
|
|
844
849
|
export interface JsonValidator {
|
|
845
850
|
compile<Schema extends TSchema>(schema: Schema): SchemaValidationFunction<Schema>;
|
|
846
851
|
}
|
|
@@ -1163,7 +1168,7 @@ export interface SchemaStatics {
|
|
|
1163
1168
|
readonly string: LeafSchema<"string", string>;
|
|
1164
1169
|
}
|
|
1165
1170
|
|
|
1166
|
-
// @alpha
|
|
1171
|
+
// @alpha @input
|
|
1167
1172
|
export interface SchemaValidationFunction<Schema extends TSchema> {
|
|
1168
1173
|
check(data: unknown): data is Static<Schema>;
|
|
1169
1174
|
}
|
|
@@ -1195,8 +1200,8 @@ export const SharedTreeFormatVersion: {
|
|
|
1195
1200
|
// @alpha
|
|
1196
1201
|
export type SharedTreeFormatVersion = typeof SharedTreeFormatVersion;
|
|
1197
1202
|
|
|
1198
|
-
// @alpha
|
|
1199
|
-
export type SharedTreeOptions = Partial<
|
|
1203
|
+
// @alpha @input
|
|
1204
|
+
export type SharedTreeOptions = Partial<CodecWriteOptions> & Partial<SharedTreeFormatOptions> & ForestOptions;
|
|
1200
1205
|
|
|
1201
1206
|
// @alpha @sealed
|
|
1202
1207
|
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBase<NodeKind.Array, TCustomMetadata> {
|
|
@@ -1557,12 +1562,12 @@ export interface TreeAlpha {
|
|
|
1557
1562
|
branch(node: TreeNode): TreeBranch | undefined;
|
|
1558
1563
|
create<const TSchema extends ImplicitFieldSchema | UnsafeUnknownSchema>(schema: UnsafeUnknownSchema extends TSchema ? ImplicitFieldSchema : TSchema & ImplicitFieldSchema, data: InsertableField<TSchema>): Unhydrated<TSchema extends ImplicitFieldSchema ? TreeFieldFromImplicitField<TSchema> : TreeNode | TreeLeafValue | undefined>;
|
|
1559
1564
|
exportCompressed(tree: TreeNode | TreeLeafValue, options: {
|
|
1560
|
-
oldestCompatibleClient: FluidClientVersion;
|
|
1561
1565
|
idCompressor?: IIdCompressor;
|
|
1562
|
-
}): JsonCompatible<IFluidHandle>;
|
|
1566
|
+
} & Pick<CodecWriteOptions, "oldestCompatibleClient">): JsonCompatible<IFluidHandle>;
|
|
1563
1567
|
exportConcise(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): ConciseTree;
|
|
1564
1568
|
exportConcise(node: TreeNode | TreeLeafValue | undefined, options?: TreeEncodingOptions): ConciseTree | undefined;
|
|
1565
1569
|
exportVerbose(node: TreeNode | TreeLeafValue, options?: TreeEncodingOptions): VerboseTree;
|
|
1570
|
+
readonly identifier: TreeIdentifierUtils;
|
|
1566
1571
|
importCompressed<const TSchema extends ImplicitFieldSchema>(schema: TSchema, compressedData: JsonCompatible<IFluidHandle>, options: {
|
|
1567
1572
|
idCompressor?: IIdCompressor;
|
|
1568
1573
|
} & ICodecOptions): Unhydrated<TreeFieldFromImplicitField<TSchema>>;
|
|
@@ -1656,6 +1661,15 @@ export interface TreeEncodingOptions {
|
|
|
1656
1661
|
// @public
|
|
1657
1662
|
export type TreeFieldFromImplicitField<TSchema extends ImplicitFieldSchema = FieldSchema> = TSchema extends FieldSchema<infer Kind, infer Types> ? ApplyKind<TreeNodeFromImplicitAllowedTypes<Types>, Kind> : TSchema extends ImplicitAllowedTypes ? TreeNodeFromImplicitAllowedTypes<TSchema> : TreeNode | TreeLeafValue | undefined;
|
|
1658
1663
|
|
|
1664
|
+
// @alpha @sealed
|
|
1665
|
+
export interface TreeIdentifierUtils {
|
|
1666
|
+
(node: TreeNode): string | undefined;
|
|
1667
|
+
create(branch: TreeBranch): string;
|
|
1668
|
+
getShort(node: TreeNode): number | undefined;
|
|
1669
|
+
lengthen(branch: TreeBranch, nodeIdentifier: number): string;
|
|
1670
|
+
shorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1659
1673
|
// @alpha
|
|
1660
1674
|
export interface TreeIndex<TKey extends TreeIndexKey, TValue> extends ReadonlyMap<TKey, TValue> {
|
|
1661
1675
|
dispose(): void;
|
package/dist/alpha.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ export {
|
|
|
147
147
|
ArrayNodePojoEmulationSchema,
|
|
148
148
|
ArrayNodeSchema,
|
|
149
149
|
BranchableTree,
|
|
150
|
+
CodecWriteOptions,
|
|
150
151
|
ConciseTree,
|
|
151
152
|
FactoryContent,
|
|
152
153
|
FactoryContentObject,
|
|
@@ -225,6 +226,7 @@ export {
|
|
|
225
226
|
TreeBranchFork,
|
|
226
227
|
TreeCompressionStrategy,
|
|
227
228
|
TreeEncodingOptions,
|
|
229
|
+
TreeIdentifierUtils,
|
|
228
230
|
TreeIndex,
|
|
229
231
|
TreeIndexKey,
|
|
230
232
|
TreeIndexNodes,
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare const SharedTree: SharedObjectKind<ITree>;
|
|
|
47
47
|
* typeboxValidator,
|
|
48
48
|
* } from "@fluid-framework/alpha";
|
|
49
49
|
* const SharedTree = configuredSharedTree({
|
|
50
|
-
* forest:
|
|
50
|
+
* forest: ForestTypeReference,
|
|
51
51
|
* jsonValidator: typeboxValidator,
|
|
52
52
|
* treeEncodeType: TreeCompressionStrategy.Uncompressed,
|
|
53
53
|
* });
|
package/dist/index.js
CHANGED
|
@@ -59,7 +59,7 @@ exports.SharedTree = internal_2.SharedTree;
|
|
|
59
59
|
* typeboxValidator,
|
|
60
60
|
* } from "@fluid-framework/alpha";
|
|
61
61
|
* const SharedTree = configuredSharedTree({
|
|
62
|
-
* forest:
|
|
62
|
+
* forest: ForestTypeReference,
|
|
63
63
|
* jsonValidator: typeboxValidator,
|
|
64
64
|
* treeEncodeType: TreeCompressionStrategy.Uncompressed,
|
|
65
65
|
* });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAiBH,+EAAoE;AAA3D,oHAAA,WAAW,OAAA;AACpB,qEAAmE;AAA1D,mHAAA,eAAe,OAAA;AA0CxB,4GAA4G;AAC5G,gEAAyE;AAAhE,8GAAA,kBAAkB,OAAA;AAI3B,mDAAmD;AACnD,4FAA4F;AAC5F;;;;MAIG;AACH,6DAA2C;AAU3C,4DAIuC;AAEvC;;;;;;;;;GASG;AACU,QAAA,UAAU,GAA4B,qBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,oBAAoB,CAAC,OAA0B;IAC9D,OAAO,IAAA,+BAA4B,EAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAFD,oDAEC;AAmBD,yDAA0E;AAAjE,2GAAA,eAAe,OAAA;AAAE,qGAAA,SAAS,OAAA;AA6BnC,8DAAiE;AAAxD,wGAAA,YAAY,OAAA;AAarB,4BAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client\n * package (e.g. `@fluidframework/azure-client`, `@fluidframework/tinylicious-client`, or `@fluidframework/odsp-client (BETA)`).\n *\n * @packageDocumentation\n */\n\n// ===============================================================\n// #region Public, Beta and Alpha (non-legacy) exports\n// #region Basic re-exports\n\nexport type {\n\tConnectionState as ConnectionStateType, // TODO: deduplicate ConnectionState types\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nexport { AttachState } from \"@fluidframework/container-definitions\";\nexport { ConnectionState } from \"@fluidframework/container-loader\";\nexport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIConnection,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tIMember,\n\tInitialObjects,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tMemberChangedListener,\n\tMyself,\n} from \"@fluidframework/fluid-static\";\nexport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nexport type {\n\tIErrorBase,\n\tIEventProvider,\n\tIDisposable,\n\tIEvent,\n\tIEventThisPlaceHolder,\n\tIErrorEvent,\n\tErasedType,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tITelemetryBaseProperties,\n\tIEventTransformer,\n\tIProvideFluidLoadable,\n\tIFluidHandleErased,\n\tTransformedEvent,\n\tTelemetryBaseEventPropertyType,\n\tTagged,\n\tReplaceIEventThisPlaceHolder,\n\tFluidObject, // Linked in doc comment\n\tFluidObjectProviderKeys, // Used by FluidObject\n\t/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n\t/* eslint-enable import/export */\n} from \"@fluidframework/core-interfaces\";\n// This is an alpha API, but this package doesn't have an alpha entry point so its imported from \"internal\".\nexport { onAssertionFailure } from \"@fluidframework/core-utils/internal\";\n\nexport type { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\n// Let the tree package manage its own API surface.\n// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.\n/* eslint-disable-next-line\n\tno-restricted-syntax,\n\timport/no-internal-modules,\n\timport/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.\n\t*/\nexport * from \"@fluidframework/tree/alpha\";\n\n// End of basic public+beta+alpha exports - nothing above this line should\n// depend on an /internal path.\n// #endregion Basic re-exports\n// ---------------------------------------------------------------\n// #region Custom re-exports\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport type { ITree } from \"@fluidframework/tree\";\nimport {\n\tSharedTree as OriginalSharedTree,\n\tconfiguredSharedTree as originalConfiguredSharedTree,\n\ttype SharedTreeOptions,\n} from \"@fluidframework/tree/internal\";\n\n/**\n * A hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @privateRemarks\n * Here we reexport SharedTree, but with the `@alpha` types (`ISharedObjectKind`) removed, just keeping the `SharedObjectKind`.\n * Doing this requires creating this new typed export rather than relying on a reexport directly from the tree package.\n * The tree package itself does not do this because it's API needs to be usable from the encapsulated API which requires `ISharedObjectKind`.\n * This package however is not intended for use by users of the encapsulated API, and therefor it can discard that interface.\n * @public\n */\nexport const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * } from \"@fluid-framework/alpha\";\n * const SharedTree = configuredSharedTree({\n * \tforest:
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAiBH,+EAAoE;AAA3D,oHAAA,WAAW,OAAA;AACpB,qEAAmE;AAA1D,mHAAA,eAAe,OAAA;AA0CxB,4GAA4G;AAC5G,gEAAyE;AAAhE,8GAAA,kBAAkB,OAAA;AAI3B,mDAAmD;AACnD,4FAA4F;AAC5F;;;;MAIG;AACH,6DAA2C;AAU3C,4DAIuC;AAEvC;;;;;;;;;GASG;AACU,QAAA,UAAU,GAA4B,qBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,oBAAoB,CAAC,OAA0B;IAC9D,OAAO,IAAA,+BAA4B,EAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAFD,oDAEC;AAmBD,yDAA0E;AAAjE,2GAAA,eAAe,OAAA;AAAE,qGAAA,SAAS,OAAA;AA6BnC,8DAAiE;AAAxD,wGAAA,YAAY,OAAA;AAarB,4BAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client\n * package (e.g. `@fluidframework/azure-client`, `@fluidframework/tinylicious-client`, or `@fluidframework/odsp-client (BETA)`).\n *\n * @packageDocumentation\n */\n\n// ===============================================================\n// #region Public, Beta and Alpha (non-legacy) exports\n// #region Basic re-exports\n\nexport type {\n\tConnectionState as ConnectionStateType, // TODO: deduplicate ConnectionState types\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nexport { AttachState } from \"@fluidframework/container-definitions\";\nexport { ConnectionState } from \"@fluidframework/container-loader\";\nexport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIConnection,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tIMember,\n\tInitialObjects,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tMemberChangedListener,\n\tMyself,\n} from \"@fluidframework/fluid-static\";\nexport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nexport type {\n\tIErrorBase,\n\tIEventProvider,\n\tIDisposable,\n\tIEvent,\n\tIEventThisPlaceHolder,\n\tIErrorEvent,\n\tErasedType,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tITelemetryBaseProperties,\n\tIEventTransformer,\n\tIProvideFluidLoadable,\n\tIFluidHandleErased,\n\tTransformedEvent,\n\tTelemetryBaseEventPropertyType,\n\tTagged,\n\tReplaceIEventThisPlaceHolder,\n\tFluidObject, // Linked in doc comment\n\tFluidObjectProviderKeys, // Used by FluidObject\n\t/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n\t/* eslint-enable import/export */\n} from \"@fluidframework/core-interfaces\";\n// This is an alpha API, but this package doesn't have an alpha entry point so its imported from \"internal\".\nexport { onAssertionFailure } from \"@fluidframework/core-utils/internal\";\n\nexport type { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\n// Let the tree package manage its own API surface.\n// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.\n/* eslint-disable-next-line\n\tno-restricted-syntax,\n\timport/no-internal-modules,\n\timport/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.\n\t*/\nexport * from \"@fluidframework/tree/alpha\";\n\n// End of basic public+beta+alpha exports - nothing above this line should\n// depend on an /internal path.\n// #endregion Basic re-exports\n// ---------------------------------------------------------------\n// #region Custom re-exports\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport type { ITree } from \"@fluidframework/tree\";\nimport {\n\tSharedTree as OriginalSharedTree,\n\tconfiguredSharedTree as originalConfiguredSharedTree,\n\ttype SharedTreeOptions,\n} from \"@fluidframework/tree/internal\";\n\n/**\n * A hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @privateRemarks\n * Here we reexport SharedTree, but with the `@alpha` types (`ISharedObjectKind`) removed, just keeping the `SharedObjectKind`.\n * Doing this requires creating this new typed export rather than relying on a reexport directly from the tree package.\n * The tree package itself does not do this because it's API needs to be usable from the encapsulated API which requires `ISharedObjectKind`.\n * This package however is not intended for use by users of the encapsulated API, and therefor it can discard that interface.\n * @public\n */\nexport const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * } from \"@fluid-framework/alpha\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestTypeReference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @alpha\n */\nexport function configuredSharedTree(options: SharedTreeOptions): SharedObjectKind<ITree> {\n\treturn originalConfiguredSharedTree(options);\n}\n\n// #endregion Custom re-exports\n// #endregion\n\n// ===============================================================\n// #region Legacy exports\n\nexport type {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEvents,\n\tISharedMap,\n\tISharedMapEvents,\n\tIValueChanged,\n} from \"@fluidframework/map/internal\";\n\nexport { SharedDirectory, SharedMap } from \"@fluidframework/map/internal\";\n\nexport type {\n\tDeserializeCallback,\n\tInteriorSequencePlace,\n\tIInterval,\n\tIntervalStickiness,\n\tISequenceDeltaRange,\n\tISerializableInterval,\n\tISerializedInterval,\n\tISharedSegmentSequenceEvents,\n\tISharedString,\n\tSequencePlace,\n\tSharedStringSegment,\n\tSide,\n\tISharedSegmentSequence,\n\tISequenceIntervalCollection,\n\tISequenceIntervalCollectionEvents,\n\tSequenceIntervalIndex,\n} from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tIntervalType,\n\tSequenceDeltaEvent,\n\tSequenceEvent,\n\tSequenceInterval,\n\tSequenceMaintenanceEvent,\n} from \"@fluidframework/sequence/internal\";\n\nexport { SharedString } from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\nexport type {\n\tISequencedDocumentMessage, // Leaked via ISharedObjectEvents\n\tIBranchOrigin, // Required for ISequencedDocumentMessage\n\tITrace, // Required for ISequencedDocumentMessage\n} from \"@fluidframework/driver-definitions/internal\";\n\n// #endregion Legacy exports\n"]}
|
package/lib/alpha.d.ts
CHANGED
|
@@ -147,6 +147,7 @@ export {
|
|
|
147
147
|
ArrayNodePojoEmulationSchema,
|
|
148
148
|
ArrayNodeSchema,
|
|
149
149
|
BranchableTree,
|
|
150
|
+
CodecWriteOptions,
|
|
150
151
|
ConciseTree,
|
|
151
152
|
FactoryContent,
|
|
152
153
|
FactoryContentObject,
|
|
@@ -225,6 +226,7 @@ export {
|
|
|
225
226
|
TreeBranchFork,
|
|
226
227
|
TreeCompressionStrategy,
|
|
227
228
|
TreeEncodingOptions,
|
|
229
|
+
TreeIdentifierUtils,
|
|
228
230
|
TreeIndex,
|
|
229
231
|
TreeIndexKey,
|
|
230
232
|
TreeIndexNodes,
|
package/lib/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare const SharedTree: SharedObjectKind<ITree>;
|
|
|
47
47
|
* typeboxValidator,
|
|
48
48
|
* } from "@fluid-framework/alpha";
|
|
49
49
|
* const SharedTree = configuredSharedTree({
|
|
50
|
-
* forest:
|
|
50
|
+
* forest: ForestTypeReference,
|
|
51
51
|
* jsonValidator: typeboxValidator,
|
|
52
52
|
* treeEncodeType: TreeCompressionStrategy.Uncompressed,
|
|
53
53
|
* });
|
package/lib/index.js
CHANGED
|
@@ -39,7 +39,7 @@ export const SharedTree = OriginalSharedTree;
|
|
|
39
39
|
* typeboxValidator,
|
|
40
40
|
* } from "@fluid-framework/alpha";
|
|
41
41
|
* const SharedTree = configuredSharedTree({
|
|
42
|
-
* forest:
|
|
42
|
+
* forest: ForestTypeReference,
|
|
43
43
|
* jsonValidator: typeboxValidator,
|
|
44
44
|
* treeEncodeType: TreeCompressionStrategy.Uncompressed,
|
|
45
45
|
* });
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AA0CnE,4GAA4G;AAC5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAIzE,mDAAmD;AACnD,4FAA4F;AAC5F;;;;MAIG;AACH,cAAc,4BAA4B,CAAC;AAU3C,OAAO,EACN,UAAU,IAAI,kBAAkB,EAChC,oBAAoB,IAAI,4BAA4B,GAEpD,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4B,kBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA0B;IAC9D,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAmBD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AA6B1E,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAajE,4BAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client\n * package (e.g. `@fluidframework/azure-client`, `@fluidframework/tinylicious-client`, or `@fluidframework/odsp-client (BETA)`).\n *\n * @packageDocumentation\n */\n\n// ===============================================================\n// #region Public, Beta and Alpha (non-legacy) exports\n// #region Basic re-exports\n\nexport type {\n\tConnectionState as ConnectionStateType, // TODO: deduplicate ConnectionState types\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nexport { AttachState } from \"@fluidframework/container-definitions\";\nexport { ConnectionState } from \"@fluidframework/container-loader\";\nexport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIConnection,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tIMember,\n\tInitialObjects,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tMemberChangedListener,\n\tMyself,\n} from \"@fluidframework/fluid-static\";\nexport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nexport type {\n\tIErrorBase,\n\tIEventProvider,\n\tIDisposable,\n\tIEvent,\n\tIEventThisPlaceHolder,\n\tIErrorEvent,\n\tErasedType,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tITelemetryBaseProperties,\n\tIEventTransformer,\n\tIProvideFluidLoadable,\n\tIFluidHandleErased,\n\tTransformedEvent,\n\tTelemetryBaseEventPropertyType,\n\tTagged,\n\tReplaceIEventThisPlaceHolder,\n\tFluidObject, // Linked in doc comment\n\tFluidObjectProviderKeys, // Used by FluidObject\n\t/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n\t/* eslint-enable import/export */\n} from \"@fluidframework/core-interfaces\";\n// This is an alpha API, but this package doesn't have an alpha entry point so its imported from \"internal\".\nexport { onAssertionFailure } from \"@fluidframework/core-utils/internal\";\n\nexport type { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\n// Let the tree package manage its own API surface.\n// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.\n/* eslint-disable-next-line\n\tno-restricted-syntax,\n\timport/no-internal-modules,\n\timport/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.\n\t*/\nexport * from \"@fluidframework/tree/alpha\";\n\n// End of basic public+beta+alpha exports - nothing above this line should\n// depend on an /internal path.\n// #endregion Basic re-exports\n// ---------------------------------------------------------------\n// #region Custom re-exports\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport type { ITree } from \"@fluidframework/tree\";\nimport {\n\tSharedTree as OriginalSharedTree,\n\tconfiguredSharedTree as originalConfiguredSharedTree,\n\ttype SharedTreeOptions,\n} from \"@fluidframework/tree/internal\";\n\n/**\n * A hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @privateRemarks\n * Here we reexport SharedTree, but with the `@alpha` types (`ISharedObjectKind`) removed, just keeping the `SharedObjectKind`.\n * Doing this requires creating this new typed export rather than relying on a reexport directly from the tree package.\n * The tree package itself does not do this because it's API needs to be usable from the encapsulated API which requires `ISharedObjectKind`.\n * This package however is not intended for use by users of the encapsulated API, and therefor it can discard that interface.\n * @public\n */\nexport const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * } from \"@fluid-framework/alpha\";\n * const SharedTree = configuredSharedTree({\n * \tforest:
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AA0CnE,4GAA4G;AAC5G,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAIzE,mDAAmD;AACnD,4FAA4F;AAC5F;;;;MAIG;AACH,cAAc,4BAA4B,CAAC;AAU3C,OAAO,EACN,UAAU,IAAI,kBAAkB,EAChC,oBAAoB,IAAI,4BAA4B,GAEpD,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,UAAU,GAA4B,kBAAkB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAA0B;IAC9D,OAAO,4BAA4B,CAAC,OAAO,CAAC,CAAC;AAC9C,CAAC;AAmBD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AA6B1E,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAajE,4BAA4B","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Bundles a collection of Fluid Framework client libraries for easy use when paired with a corresponding service client\n * package (e.g. `@fluidframework/azure-client`, `@fluidframework/tinylicious-client`, or `@fluidframework/odsp-client (BETA)`).\n *\n * @packageDocumentation\n */\n\n// ===============================================================\n// #region Public, Beta and Alpha (non-legacy) exports\n// #region Basic re-exports\n\nexport type {\n\tConnectionState as ConnectionStateType, // TODO: deduplicate ConnectionState types\n\tICriticalContainerError,\n} from \"@fluidframework/container-definitions\";\nexport { AttachState } from \"@fluidframework/container-definitions\";\nexport { ConnectionState } from \"@fluidframework/container-loader\";\nexport type {\n\tContainerAttachProps,\n\tContainerSchema,\n\tIConnection,\n\tIFluidContainer,\n\tIFluidContainerEvents,\n\tIMember,\n\tInitialObjects,\n\tIServiceAudience,\n\tIServiceAudienceEvents,\n\tMemberChangedListener,\n\tMyself,\n} from \"@fluidframework/fluid-static\";\nexport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nexport type {\n\tIErrorBase,\n\tIEventProvider,\n\tIDisposable,\n\tIEvent,\n\tIEventThisPlaceHolder,\n\tIErrorEvent,\n\tErasedType,\n\tIFluidHandle,\n\tIFluidLoadable,\n\tITelemetryBaseProperties,\n\tIEventTransformer,\n\tIProvideFluidLoadable,\n\tIFluidHandleErased,\n\tTransformedEvent,\n\tTelemetryBaseEventPropertyType,\n\tTagged,\n\tReplaceIEventThisPlaceHolder,\n\tFluidObject, // Linked in doc comment\n\tFluidObjectProviderKeys, // Used by FluidObject\n\t/* eslint-disable import/export -- The event APIs are known to conflict, and this is intended as the exports via `@fluidframework/core-interfaces` are preferred over the deprecated ones from `@fluidframework/tree`. */\n\tListeners,\n\tIsListener,\n\tListenable,\n\tOff,\n\t/* eslint-enable import/export */\n} from \"@fluidframework/core-interfaces\";\n// This is an alpha API, but this package doesn't have an alpha entry point so its imported from \"internal\".\nexport { onAssertionFailure } from \"@fluidframework/core-utils/internal\";\n\nexport type { isFluidHandle } from \"@fluidframework/runtime-utils\";\n\n// Let the tree package manage its own API surface.\n// Note: this only surfaces the `@public, @beta and @alpha` API items from the tree package.\n/* eslint-disable-next-line\n\tno-restricted-syntax,\n\timport/no-internal-modules,\n\timport/export -- This re-exports all non-conflicting APIs from `@fluidframework/tree`. In cases where * exports conflict with named exports, the named exports take precedence per https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#sec-getexportednames. This does trigger the `import/export` lint warning (which is intentionally disabled here). This approach ensures that the non-deprecated versions of the event APIs from `@fluidframework/core-interfaces` (provided as named indirect exports) eclipse the deprecated ones from `@fluidframework/tree`. The preferred versions of the event APIs are those exported via `@fluidframework/core-interfaces`.\n\t*/\nexport * from \"@fluidframework/tree/alpha\";\n\n// End of basic public+beta+alpha exports - nothing above this line should\n// depend on an /internal path.\n// #endregion Basic re-exports\n// ---------------------------------------------------------------\n// #region Custom re-exports\n\nimport type { SharedObjectKind } from \"@fluidframework/shared-object-base\";\nimport type { ITree } from \"@fluidframework/tree\";\nimport {\n\tSharedTree as OriginalSharedTree,\n\tconfiguredSharedTree as originalConfiguredSharedTree,\n\ttype SharedTreeOptions,\n} from \"@fluidframework/tree/internal\";\n\n/**\n * A hierarchical data structure for collaboratively editing strongly typed JSON-like trees\n * of objects, arrays, and other data types.\n * @privateRemarks\n * Here we reexport SharedTree, but with the `@alpha` types (`ISharedObjectKind`) removed, just keeping the `SharedObjectKind`.\n * Doing this requires creating this new typed export rather than relying on a reexport directly from the tree package.\n * The tree package itself does not do this because it's API needs to be usable from the encapsulated API which requires `ISharedObjectKind`.\n * This package however is not intended for use by users of the encapsulated API, and therefor it can discard that interface.\n * @public\n */\nexport const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;\n\n/**\n * {@link SharedTree} but allowing a non-default configuration.\n * @remarks\n * This is useful for debugging and testing to opt into extra validation or see if opting out of some optimizations fixes an issue.\n * @example\n * ```typescript\n * import {\n * \tForestType,\n * \tTreeCompressionStrategy,\n * \tconfiguredSharedTree,\n * \ttypeboxValidator,\n * } from \"@fluid-framework/alpha\";\n * const SharedTree = configuredSharedTree({\n * \tforest: ForestTypeReference,\n * \tjsonValidator: typeboxValidator,\n * \ttreeEncodeType: TreeCompressionStrategy.Uncompressed,\n * });\n * ```\n * @alpha\n */\nexport function configuredSharedTree(options: SharedTreeOptions): SharedObjectKind<ITree> {\n\treturn originalConfiguredSharedTree(options);\n}\n\n// #endregion Custom re-exports\n// #endregion\n\n// ===============================================================\n// #region Legacy exports\n\nexport type {\n\tIDirectory,\n\tIDirectoryEvents,\n\tIDirectoryValueChanged,\n\tISharedDirectory,\n\tISharedDirectoryEvents,\n\tISharedMap,\n\tISharedMapEvents,\n\tIValueChanged,\n} from \"@fluidframework/map/internal\";\n\nexport { SharedDirectory, SharedMap } from \"@fluidframework/map/internal\";\n\nexport type {\n\tDeserializeCallback,\n\tInteriorSequencePlace,\n\tIInterval,\n\tIntervalStickiness,\n\tISequenceDeltaRange,\n\tISerializableInterval,\n\tISerializedInterval,\n\tISharedSegmentSequenceEvents,\n\tISharedString,\n\tSequencePlace,\n\tSharedStringSegment,\n\tSide,\n\tISharedSegmentSequence,\n\tISequenceIntervalCollection,\n\tISequenceIntervalCollectionEvents,\n\tSequenceIntervalIndex,\n} from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tIntervalType,\n\tSequenceDeltaEvent,\n\tSequenceEvent,\n\tSequenceInterval,\n\tSequenceMaintenanceEvent,\n} from \"@fluidframework/sequence/internal\";\n\nexport { SharedString } from \"@fluidframework/sequence/internal\";\n\nexport type {\n\tISharedObject,\n\tISharedObjectEvents,\n} from \"@fluidframework/shared-object-base/internal\";\n\nexport type {\n\tISequencedDocumentMessage, // Leaked via ISharedObjectEvents\n\tIBranchOrigin, // Required for ISequencedDocumentMessage\n\tITrace, // Required for ISequencedDocumentMessage\n} from \"@fluidframework/driver-definitions/internal\";\n\n// #endregion Legacy exports\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.42.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.
|
|
61
|
-
"@fluidframework/container-loader": "2.
|
|
62
|
-
"@fluidframework/core-interfaces": "2.
|
|
63
|
-
"@fluidframework/core-utils": "2.
|
|
64
|
-
"@fluidframework/driver-definitions": "2.
|
|
65
|
-
"@fluidframework/fluid-static": "2.
|
|
66
|
-
"@fluidframework/map": "2.
|
|
67
|
-
"@fluidframework/runtime-utils": "2.
|
|
68
|
-
"@fluidframework/sequence": "2.
|
|
69
|
-
"@fluidframework/shared-object-base": "2.
|
|
70
|
-
"@fluidframework/tree": "2.
|
|
60
|
+
"@fluidframework/container-definitions": "~2.42.0",
|
|
61
|
+
"@fluidframework/container-loader": "~2.42.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~2.42.0",
|
|
63
|
+
"@fluidframework/core-utils": "~2.42.0",
|
|
64
|
+
"@fluidframework/driver-definitions": "~2.42.0",
|
|
65
|
+
"@fluidframework/fluid-static": "~2.42.0",
|
|
66
|
+
"@fluidframework/map": "~2.42.0",
|
|
67
|
+
"@fluidframework/runtime-utils": "~2.42.0",
|
|
68
|
+
"@fluidframework/sequence": "~2.42.0",
|
|
69
|
+
"@fluidframework/shared-object-base": "~2.42.0",
|
|
70
|
+
"@fluidframework/tree": "~2.42.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@fluid-tools/build-cli": "^0.55.0",
|
|
76
76
|
"@fluidframework/build-common": "^2.0.3",
|
|
77
77
|
"@fluidframework/build-tools": "^0.55.0",
|
|
78
|
-
"@fluidframework/eslint-config-fluid": "^5.7.
|
|
78
|
+
"@fluidframework/eslint-config-fluid": "^5.7.4",
|
|
79
79
|
"@microsoft/api-extractor": "7.52.8",
|
|
80
80
|
"@types/node": "^18.19.0",
|
|
81
81
|
"concurrently": "^8.2.1",
|
package/src/index.ts
CHANGED
|
@@ -114,7 +114,7 @@ export const SharedTree: SharedObjectKind<ITree> = OriginalSharedTree;
|
|
|
114
114
|
* typeboxValidator,
|
|
115
115
|
* } from "@fluid-framework/alpha";
|
|
116
116
|
* const SharedTree = configuredSharedTree({
|
|
117
|
-
* forest:
|
|
117
|
+
* forest: ForestTypeReference,
|
|
118
118
|
* jsonValidator: typeboxValidator,
|
|
119
119
|
* treeEncodeType: TreeCompressionStrategy.Uncompressed,
|
|
120
120
|
* });
|