Skip to content

Commit fe59978

Browse files
Merge branch 'main' into check-events-with-rollback
2 parents d8fb934 + 4378159 commit fe59978

14 files changed

+46
-24
lines changed

packages/dds/tree/api-report/tree.alpha.api.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
216216
// (undocumented)
217217
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
218218
get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes;
219+
// (undocumented)
219220
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
220221
}
221222

@@ -617,12 +618,12 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
617618
readonly description?: string | undefined;
618619
}
619620

620-
// @public @sealed
621+
// @public @input
621622
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
622623
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
623624
}
624625

625-
// @alpha
626+
// @alpha @input
626627
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
627628
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
628629
}
@@ -858,9 +859,9 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
858859
staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
859860
}
860861

861-
// @alpha
862+
// @alpha @input
862863
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptionsAlpha<TCustomMetadata> {
863-
allowUnknownOptionalFields?: boolean;
864+
readonly allowUnknownOptionalFields?: boolean;
864865
}
865866

866867
// @public @sealed @system

packages/dds/tree/api-report/tree.beta.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
252252
readonly description?: string | undefined;
253253
}
254254

255-
// @public @sealed
255+
// @public @input
256256
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
257257
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
258258
}

packages/dds/tree/api-report/tree.legacy.alpha.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
225225
readonly description?: string | undefined;
226226
}
227227

228-
// @public @sealed
228+
// @public @input
229229
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
230230
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
231231
}

packages/dds/tree/api-report/tree.legacy.public.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
225225
readonly description?: string | undefined;
226226
}
227227

228-
// @public @sealed
228+
// @public @input
229229
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
230230
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
231231
}

packages/dds/tree/api-report/tree.public.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
225225
readonly description?: string | undefined;
226226
}
227227

228-
// @public @sealed
228+
// @public @input
229229
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
230230
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
231231
}

packages/dds/tree/src/simple-tree/api/schemaFactory.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ export function schemaFromValue(value: TreeValue): TreeNodeSchema {
9898
/**
9999
* Options when declaring an {@link SchemaFactory.object|object node}'s schema
100100
*
101+
* @input
101102
* @alpha
102103
*/
103104
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>
@@ -147,7 +148,7 @@ export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown>
147148
* It's only when application code reaches into a node
148149
* (either by accessing its fields, spreading it, or some other means) that this problem arises.
149150
*/
150-
allowUnknownOptionalFields?: boolean;
151+
readonly allowUnknownOptionalFields?: boolean;
151152
}
152153

153154
/**
@@ -1077,16 +1078,15 @@ const globalIdentifierAllocator: IIdCompressor = createIdCompressor();
10771078
* @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.
10781079
* See {@link NodeSchemaMetadata.custom}.
10791080
*
1080-
* @sealed
1081+
* @input
10811082
* @public
10821083
*/
10831084
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
10841085
/**
10851086
* Optional metadata to associate with the Node Schema.
10861087
*
10871088
* @remarks
1088-
* Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.
1089-
* Different clients in the same collaborative session may see different metadata for the same field.
1089+
* This specifies {@link SimpleNodeSchemaBase.metadata} which has more details about its use.
10901090
*/
10911091
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
10921092
}
@@ -1097,12 +1097,15 @@ export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
10971097
* @typeParam TCustomMetadata - Custom metadata properties to associate with the Node Schema.
10981098
* See {@link NodeSchemaMetadata.custom}.
10991099
*
1100+
* @input
11001101
* @alpha
11011102
*/
11021103
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown>
11031104
extends NodeSchemaOptions<TCustomMetadata> {
11041105
/**
11051106
* The persisted metadata for this schema element.
1107+
* @remarks
1108+
* This gets exposed via {@link SimpleNodeSchemaBaseAlpha.persistedMetadata}.
11061109
*/
11071110
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
11081111
}

packages/dds/tree/src/simple-tree/core/simpleNodeSchemaBase.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ export interface SimpleNodeSchemaBase<
2525

2626
/**
2727
* User-provided {@link NodeSchemaMetadata} for this schema.
28+
*
29+
* @remarks
30+
* Note: this metadata is not persisted nor made part of the collaborative state; it is strictly client-local.
31+
* Different clients in the same collaborative session may see different metadata for the same field.
32+
*
33+
* Set via {@link NodeSchemaOptions.metadata}.
2834
*/
2935
readonly metadata: NodeSchemaMetadata<TCustomMetadata>;
3036
}

packages/dds/tree/src/simple-tree/fieldSchema.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,9 @@ export interface FieldProps<TCustomMetadata = unknown> {
187187
export interface FieldPropsAlpha<TCustomMetadata = unknown>
188188
extends FieldProps<TCustomMetadata> {
189189
/**
190-
* The persisted metadata for this schema element.
190+
* The persisted metadata for a field schema.
191+
* @remarks
192+
* Sets {@link SimpleFieldSchema.persistedMetadata}.
191193
*/
192194
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
193195
}
@@ -428,9 +430,6 @@ export class FieldSchemaAlpha<
428430
*/
429431
public readonly allowedTypesMetadata: AllowedTypesMetadata;
430432

431-
/**
432-
* Persisted metadata for this field schema.
433-
*/
434433
public get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined {
435434
return this.propsAlpha?.persistedMetadata;
436435
}

packages/dds/tree/src/simple-tree/simpleSchema.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ export interface SimpleNodeSchemaBaseAlpha<
2626
> extends SimpleNodeSchemaBase<TNodeKind, TCustomMetadata> {
2727
/**
2828
* Persisted metadata for this node schema.
29+
* @remarks
30+
* While this can be stored in the document, not all versions / configurations will do so.
31+
* Additionally, this is not part of {@link TreeView.compatibility|schema compatibility}, so different clients
32+
* (even within the same collaborative session) may see different `persistedMetadata` for the same node.
33+
* Specified using {@link NodeSchemaOptionsAlpha.persistedMetadata}.
34+
* @privateRemarks
35+
* How/when this gets updated in documents,
36+
* and how to read it from documents should be documented here when this feature is more mature and these questions have good answers.
37+
* If this does end up getting reflected in some compatibility value, that should also be documented.
2938
*/
3039
readonly persistedMetadata: JsonCompatibleReadOnlyObject | undefined;
3140
}
@@ -184,6 +193,9 @@ export interface SimpleFieldSchema {
184193

185194
/**
186195
* Persisted metadata for this field schema.
196+
* @remarks
197+
* Like {@link SimpleNodeSchemaBaseAlpha.persistedMetadata} but for fields.
198+
* Set via {@link FieldPropsAlpha.persistedMetadata}.
187199
*/
188200
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
189201
}

packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ export class FieldSchemaAlpha<Kind extends FieldKind = FieldKind, Types extends
264264
// (undocumented)
265265
readonly annotatedAllowedTypes: ImplicitAnnotatedAllowedTypes;
266266
get annotatedAllowedTypesNormalized(): NormalizedAnnotatedAllowedTypes;
267+
// (undocumented)
267268
get persistedMetadata(): JsonCompatibleReadOnlyObject | undefined;
268269
}
269270

@@ -973,12 +974,12 @@ export interface NodeSchemaMetadata<out TCustomMetadata = unknown> {
973974
readonly description?: string | undefined;
974975
}
975976

976-
// @public @sealed
977+
// @public @input
977978
export interface NodeSchemaOptions<out TCustomMetadata = unknown> {
978979
readonly metadata?: NodeSchemaMetadata<TCustomMetadata> | undefined;
979980
}
980981

981-
// @alpha
982+
// @alpha @input
982983
export interface NodeSchemaOptionsAlpha<out TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
983984
readonly persistedMetadata?: JsonCompatibleReadOnlyObject | undefined;
984985
}
@@ -1222,9 +1223,9 @@ export class SchemaFactoryAlpha<out TScope extends string | undefined = string |
12221223
staged: <const T extends LazyItem<TreeNodeSchema>>(t: T | AnnotatedAllowedType<T>) => AnnotatedAllowedType<T>;
12231224
}
12241225

1225-
// @alpha
1226+
// @alpha @input
12261227
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptionsAlpha<TCustomMetadata> {
1227-
allowUnknownOptionalFields?: boolean;
1228+
readonly allowUnknownOptionalFields?: boolean;
12281229
}
12291230

12301231
// @public @sealed @system

0 commit comments

Comments
 (0)