fluid-framework 2.70.0 → 2.71.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 +49 -0
- package/api-report/fluid-framework.alpha.api.md +26 -4
- package/api-report/fluid-framework.beta.api.md +4 -0
- package/api-report/fluid-framework.legacy.beta.api.md +4 -0
- package/api-report/fluid-framework.legacy.public.api.md +1 -0
- package/api-report/fluid-framework.public.api.md +1 -0
- package/dist/alpha.d.ts +3 -0
- package/dist/beta.d.ts +1 -0
- package/dist/legacy.d.ts +1 -0
- package/lib/alpha.d.ts +3 -0
- package/lib/beta.d.ts +1 -0
- package/lib/legacy.d.ts +1 -0
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# fluid-framework
|
|
2
2
|
|
|
3
|
+
## 2.71.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add IndependentTree API ([#25785](https://github.com/microsoft/FluidFramework/pull/25785)) [21c4245a25](https://github.com/microsoft/FluidFramework/commit/21c4245a25f60f939434b65c5555b13a4d54ea17)
|
|
8
|
+
|
|
9
|
+
New `IndependentTreeAlpha` and `IndependentTreeBeta` APIs provide similar utility to the existing alpha [`IndependentView`](https://fluidframework.com/docs/api/tree#independentview-function) API, except providing access to the [`ViewableTree`](https://fluidframework.com/docs/api/fluid-framework/viewabletree-interface).
|
|
10
|
+
|
|
11
|
+
This allows for multiple views (in sequence, not concurrently) to be created to test things like schema upgrades and incompatible view schema much more easily (see example below).
|
|
12
|
+
For `IndependentTreeAlpha`, this also provides access to `exportVerbose` and `exportSimpleSchema` from [`ITreeAlpha`](https://fluidframework.com/docs/api/tree/itreealpha-interface).
|
|
13
|
+
|
|
14
|
+
An example of how to use `createIndependentTreeBeta` to create multiple views to test a schema upgrade:
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
const tree = createIndependentTreeBeta();
|
|
18
|
+
|
|
19
|
+
const stagedConfig = new TreeViewConfiguration({
|
|
20
|
+
schema: SchemaFactoryAlpha.types([
|
|
21
|
+
SchemaFactory.number,
|
|
22
|
+
SchemaFactoryAlpha.staged(SchemaFactory.string),
|
|
23
|
+
]),
|
|
24
|
+
});
|
|
25
|
+
const afterConfig = new TreeViewConfigurationAlpha({
|
|
26
|
+
schema: [SchemaFactory.number, SchemaFactory.string],
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Initialize tree
|
|
30
|
+
{
|
|
31
|
+
const view = tree.viewWith(stagedConfig);
|
|
32
|
+
view.initialize(1);
|
|
33
|
+
view.dispose();
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Do schema upgrade
|
|
37
|
+
{
|
|
38
|
+
const view = tree.viewWith(afterConfig);
|
|
39
|
+
view.upgradeSchema();
|
|
40
|
+
view.root = "A";
|
|
41
|
+
view.dispose();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Can still view tree with staged schema
|
|
45
|
+
{
|
|
46
|
+
const view = tree.viewWith(stagedConfig);
|
|
47
|
+
assert.equal(view.root, "A");
|
|
48
|
+
view.dispose();
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
3
52
|
## 2.70.0
|
|
4
53
|
|
|
5
54
|
### Minor Changes
|
|
@@ -214,6 +214,20 @@ export const contentSchemaSymbol: unique symbol;
|
|
|
214
214
|
// @alpha
|
|
215
215
|
export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(view: TreeView<TSchema>): IdentifierIndex;
|
|
216
216
|
|
|
217
|
+
// @alpha
|
|
218
|
+
export function createIndependentTreeAlpha<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions & (({
|
|
219
|
+
idCompressor?: IIdCompressor_2 | undefined;
|
|
220
|
+
} & {
|
|
221
|
+
content?: undefined;
|
|
222
|
+
}) | (ICodecOptions & {
|
|
223
|
+
content: ViewContent;
|
|
224
|
+
} & {
|
|
225
|
+
idCompressor?: undefined;
|
|
226
|
+
}))): ViewableTree & Pick<ITreeAlpha, "exportVerbose" | "exportSimpleSchema">;
|
|
227
|
+
|
|
228
|
+
// @beta
|
|
229
|
+
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
|
|
230
|
+
|
|
217
231
|
// @alpha
|
|
218
232
|
export function createSimpleTreeIndex<TFieldSchema extends ImplicitFieldSchema, TKey extends TreeIndexKey, TValue>(view: TreeView<TFieldSchema>, indexer: (schema: TreeNodeSchema) => string | undefined, getValue: (nodes: TreeIndexNodes<TreeNode>) => TValue, isKeyValid: (key: TreeIndexKey) => key is TKey): SimpleTreeIndex<TKey, TValue>;
|
|
219
233
|
|
|
@@ -328,6 +342,8 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
|
|
|
328
342
|
get allowedTypesIdentifiers(): ReadonlySet<string>;
|
|
329
343
|
// (undocumented)
|
|
330
344
|
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
|
|
345
|
+
// (undocumented)
|
|
346
|
+
get simpleAllowedTypes(): ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
331
347
|
}
|
|
332
348
|
|
|
333
349
|
// @alpha @sealed @system
|
|
@@ -976,6 +992,7 @@ export interface LeafSchema<Name extends string, T extends TreeLeafValue> extend
|
|
|
976
992
|
// @public @sealed
|
|
977
993
|
export interface Listenable<TListeners extends object> {
|
|
978
994
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
995
|
+
// (undocumented)
|
|
979
996
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
980
997
|
}
|
|
981
998
|
|
|
@@ -1382,17 +1399,22 @@ export type SharedTreeOptions = Partial<CodecWriteOptions> & Partial<SharedTreeF
|
|
|
1382
1399
|
// @beta @input
|
|
1383
1400
|
export type SharedTreeOptionsBeta = ForestOptions;
|
|
1384
1401
|
|
|
1402
|
+
// @alpha @sealed
|
|
1403
|
+
export interface SimpleAllowedTypeAttributes {
|
|
1404
|
+
readonly isStaged: boolean | undefined;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1385
1407
|
// @alpha @sealed
|
|
1386
1408
|
export interface SimpleArrayNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Array, TCustomMetadata> {
|
|
1387
|
-
readonly
|
|
1409
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1388
1410
|
}
|
|
1389
1411
|
|
|
1390
1412
|
// @alpha @sealed
|
|
1391
1413
|
export interface SimpleFieldSchema {
|
|
1392
|
-
readonly allowedTypesIdentifiers: ReadonlySet<string>;
|
|
1393
1414
|
readonly kind: FieldKind;
|
|
1394
1415
|
readonly metadata: FieldSchemaMetadata;
|
|
1395
1416
|
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
|
|
1417
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1396
1418
|
}
|
|
1397
1419
|
|
|
1398
1420
|
// @alpha @sealed
|
|
@@ -1402,7 +1424,7 @@ export interface SimpleLeafNodeSchema extends SimpleNodeSchemaBaseAlpha<NodeKind
|
|
|
1402
1424
|
|
|
1403
1425
|
// @alpha @sealed
|
|
1404
1426
|
export interface SimpleMapNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Map, TCustomMetadata> {
|
|
1405
|
-
readonly
|
|
1427
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1406
1428
|
}
|
|
1407
1429
|
|
|
1408
1430
|
// @alpha
|
|
@@ -1431,7 +1453,7 @@ export interface SimpleObjectNodeSchema<out TCustomMetadata = unknown> extends S
|
|
|
1431
1453
|
|
|
1432
1454
|
// @alpha @sealed
|
|
1433
1455
|
export interface SimpleRecordNodeSchema<out TCustomMetadata = unknown> extends SimpleNodeSchemaBaseAlpha<NodeKind.Record, TCustomMetadata> {
|
|
1434
|
-
readonly
|
|
1456
|
+
readonly simpleAllowedTypes: ReadonlyMap<string, SimpleAllowedTypeAttributes>;
|
|
1435
1457
|
}
|
|
1436
1458
|
|
|
1437
1459
|
// @alpha
|
|
@@ -133,6 +133,9 @@ export interface ContainerSchema {
|
|
|
133
133
|
readonly initialObjects: Record<string, SharedObjectKind>;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
// @beta
|
|
137
|
+
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
|
|
138
|
+
|
|
136
139
|
// @public @sealed @system
|
|
137
140
|
interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
138
141
|
}
|
|
@@ -667,6 +670,7 @@ export interface LeafSchema<Name extends string, T extends TreeLeafValue> extend
|
|
|
667
670
|
// @public @sealed
|
|
668
671
|
export interface Listenable<TListeners extends object> {
|
|
669
672
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
673
|
+
// (undocumented)
|
|
670
674
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
671
675
|
}
|
|
672
676
|
|
|
@@ -133,6 +133,9 @@ export interface ContainerSchema {
|
|
|
133
133
|
readonly initialObjects: Record<string, SharedObjectKind>;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
+
// @beta
|
|
137
|
+
export function createIndependentTreeBeta<const TSchema extends ImplicitFieldSchema>(options?: ForestOptions): ViewableTree;
|
|
138
|
+
|
|
136
139
|
// @public @sealed @system
|
|
137
140
|
interface DefaultProvider extends ErasedType<"@fluidframework/tree.FieldProvider"> {
|
|
138
141
|
}
|
|
@@ -945,6 +948,7 @@ export interface LeafSchema<Name extends string, T extends TreeLeafValue> extend
|
|
|
945
948
|
// @public @sealed
|
|
946
949
|
export interface Listenable<TListeners extends object> {
|
|
947
950
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
951
|
+
// (undocumented)
|
|
948
952
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
949
953
|
}
|
|
950
954
|
|
|
@@ -562,6 +562,7 @@ export interface LeafSchema<Name extends string, T extends TreeLeafValue> extend
|
|
|
562
562
|
// @public @sealed
|
|
563
563
|
export interface Listenable<TListeners extends object> {
|
|
564
564
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
565
|
+
// (undocumented)
|
|
565
566
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
566
567
|
}
|
|
567
568
|
|
|
@@ -528,6 +528,7 @@ export interface LeafSchema<Name extends string, T extends TreeLeafValue> extend
|
|
|
528
528
|
// @public @sealed
|
|
529
529
|
export interface Listenable<TListeners extends object> {
|
|
530
530
|
off<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): void;
|
|
531
|
+
// (undocumented)
|
|
531
532
|
on<K extends keyof Listeners<TListeners>>(eventName: K, listener: TListeners[K]): Off;
|
|
532
533
|
}
|
|
533
534
|
|
package/dist/alpha.d.ts
CHANGED
|
@@ -176,6 +176,7 @@ export {
|
|
|
176
176
|
adaptEnum,
|
|
177
177
|
asBeta,
|
|
178
178
|
configuredSharedTreeBeta,
|
|
179
|
+
createIndependentTreeBeta,
|
|
179
180
|
enumFromStrings,
|
|
180
181
|
singletonSchema,
|
|
181
182
|
// #endregion
|
|
@@ -249,6 +250,7 @@ export {
|
|
|
249
250
|
SharedTreeFormatOptions,
|
|
250
251
|
SharedTreeFormatVersion,
|
|
251
252
|
SharedTreeOptions,
|
|
253
|
+
SimpleAllowedTypeAttributes,
|
|
252
254
|
SimpleArrayNodeSchema,
|
|
253
255
|
SimpleFieldSchema,
|
|
254
256
|
SimpleLeafNodeSchema,
|
|
@@ -297,6 +299,7 @@ export {
|
|
|
297
299
|
configuredSharedTree,
|
|
298
300
|
contentSchemaSymbol,
|
|
299
301
|
createIdentifierIndex,
|
|
302
|
+
createIndependentTreeAlpha,
|
|
300
303
|
createSimpleTreeIndex,
|
|
301
304
|
evaluateLazySchema,
|
|
302
305
|
extractPersistedSchema,
|
package/dist/beta.d.ts
CHANGED
package/dist/legacy.d.ts
CHANGED
package/lib/alpha.d.ts
CHANGED
|
@@ -176,6 +176,7 @@ export {
|
|
|
176
176
|
adaptEnum,
|
|
177
177
|
asBeta,
|
|
178
178
|
configuredSharedTreeBeta,
|
|
179
|
+
createIndependentTreeBeta,
|
|
179
180
|
enumFromStrings,
|
|
180
181
|
singletonSchema,
|
|
181
182
|
// #endregion
|
|
@@ -249,6 +250,7 @@ export {
|
|
|
249
250
|
SharedTreeFormatOptions,
|
|
250
251
|
SharedTreeFormatVersion,
|
|
251
252
|
SharedTreeOptions,
|
|
253
|
+
SimpleAllowedTypeAttributes,
|
|
252
254
|
SimpleArrayNodeSchema,
|
|
253
255
|
SimpleFieldSchema,
|
|
254
256
|
SimpleLeafNodeSchema,
|
|
@@ -297,6 +299,7 @@ export {
|
|
|
297
299
|
configuredSharedTree,
|
|
298
300
|
contentSchemaSymbol,
|
|
299
301
|
createIdentifierIndex,
|
|
302
|
+
createIndependentTreeAlpha,
|
|
300
303
|
createSimpleTreeIndex,
|
|
301
304
|
evaluateLazySchema,
|
|
302
305
|
extractPersistedSchema,
|
package/lib/beta.d.ts
CHANGED
package/lib/legacy.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fluid-framework",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.71.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.71.0",
|
|
61
|
+
"@fluidframework/container-loader": "~2.71.0",
|
|
62
|
+
"@fluidframework/core-interfaces": "~2.71.0",
|
|
63
|
+
"@fluidframework/core-utils": "~2.71.0",
|
|
64
|
+
"@fluidframework/driver-definitions": "~2.71.0",
|
|
65
|
+
"@fluidframework/fluid-static": "~2.71.0",
|
|
66
|
+
"@fluidframework/map": "~2.71.0",
|
|
67
|
+
"@fluidframework/runtime-utils": "~2.71.0",
|
|
68
|
+
"@fluidframework/sequence": "~2.71.0",
|
|
69
|
+
"@fluidframework/shared-object-base": "~2.71.0",
|
|
70
|
+
"@fluidframework/tree": "~2.71.0"
|
|
71
71
|
},
|
|
72
72
|
"devDependencies": {
|
|
73
73
|
"@arethetypeswrong/cli": "^0.17.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"@fluid-tools/build-cli": "^0.58.3",
|
|
76
76
|
"@fluidframework/build-common": "^2.0.3",
|
|
77
77
|
"@fluidframework/build-tools": "^0.58.3",
|
|
78
|
-
"@fluidframework/eslint-config-fluid": "^
|
|
78
|
+
"@fluidframework/eslint-config-fluid": "^7.0.0",
|
|
79
79
|
"@microsoft/api-extractor": "7.52.11",
|
|
80
80
|
"@types/node": "^18.19.0",
|
|
81
81
|
"concurrently": "^8.2.1",
|
|
@@ -129,8 +129,8 @@
|
|
|
129
129
|
"ci:build:api-reports:legacy": "api-extractor run --config api-extractor/api-extractor.legacy.json",
|
|
130
130
|
"ci:build:docs": "api-extractor run",
|
|
131
131
|
"clean": "rimraf --glob _api-extractor-temp dist lib {alpha,beta,internal,legacy}.d.ts \"**/*.tsbuildinfo\" \"**/*.build.log\"",
|
|
132
|
-
"eslint": "eslint --format stylish src",
|
|
133
|
-
"eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
132
|
+
"eslint": "eslint --quiet --format stylish src",
|
|
133
|
+
"eslint:fix": "eslint --quiet --format stylish src --fix --fix-type problem,suggestion,layout",
|
|
134
134
|
"format": "npm run format:biome",
|
|
135
135
|
"format:biome": "biome check . --write",
|
|
136
136
|
"lint": "fluid-build . --task lint",
|