@fluidframework/tree 2.82.0 → 2.83.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.
Files changed (281) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +33 -5
  3. package/api-report/tree.alpha.api.md +25 -21
  4. package/api-report/tree.beta.api.md +14 -2
  5. package/api-report/tree.legacy.beta.api.md +14 -2
  6. package/api-report/tree.legacy.public.api.md +1 -1
  7. package/api-report/tree.public.api.md +1 -1
  8. package/dist/alpha.d.ts +3 -3
  9. package/dist/beta.d.ts +1 -0
  10. package/dist/codec/codec.d.ts +3 -39
  11. package/dist/codec/codec.d.ts.map +1 -1
  12. package/dist/codec/codec.js +5 -50
  13. package/dist/codec/codec.js.map +1 -1
  14. package/dist/codec/index.d.ts +1 -1
  15. package/dist/codec/index.d.ts.map +1 -1
  16. package/dist/codec/index.js +1 -2
  17. package/dist/codec/index.js.map +1 -1
  18. package/dist/codec/versioned/codec.d.ts +20 -7
  19. package/dist/codec/versioned/codec.d.ts.map +1 -1
  20. package/dist/codec/versioned/codec.js +56 -30
  21. package/dist/codec/versioned/codec.js.map +1 -1
  22. package/dist/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  23. package/dist/core/tree/detachedFieldIndexCodecs.js +6 -4
  24. package/dist/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  25. package/dist/extensibleUnionNode.d.ts +97 -0
  26. package/dist/extensibleUnionNode.d.ts.map +1 -0
  27. package/dist/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
  28. package/dist/extensibleUnionNode.js.map +1 -0
  29. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  30. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  31. package/dist/feature-libraries/chunked-forest/codec/codecs.js +4 -4
  32. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  33. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  34. package/dist/feature-libraries/forest-summary/codec.js +7 -1
  35. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  36. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
  37. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  38. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  39. package/dist/feature-libraries/forest-summary/formatV1.d.ts +2 -3
  40. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  41. package/dist/feature-libraries/forest-summary/formatV1.js +1 -2
  42. package/dist/feature-libraries/forest-summary/formatV1.js.map +1 -1
  43. package/dist/feature-libraries/forest-summary/formatV2.d.ts +2 -3
  44. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  45. package/dist/feature-libraries/forest-summary/formatV2.js +1 -2
  46. package/dist/feature-libraries/forest-summary/formatV2.js.map +1 -1
  47. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +2 -2
  48. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  49. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -4
  50. package/dist/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  51. package/dist/feature-libraries/schema-index/codec.d.ts.map +1 -1
  52. package/dist/feature-libraries/schema-index/codec.js +6 -4
  53. package/dist/feature-libraries/schema-index/codec.js.map +1 -1
  54. package/dist/index.d.ts +2 -2
  55. package/dist/index.d.ts.map +1 -1
  56. package/dist/index.js +4 -4
  57. package/dist/index.js.map +1 -1
  58. package/dist/legacy.d.ts +1 -0
  59. package/dist/packageVersion.d.ts +1 -1
  60. package/dist/packageVersion.js +1 -1
  61. package/dist/packageVersion.js.map +1 -1
  62. package/dist/shared-tree/sharedTreeChangeCodecs.js +1 -1
  63. package/dist/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  64. package/dist/shared-tree/tree.d.ts +1 -1
  65. package/dist/shared-tree/tree.js.map +1 -1
  66. package/dist/shared-tree/treeAlpha.d.ts +1 -1
  67. package/dist/shared-tree/treeAlpha.js.map +1 -1
  68. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  69. package/dist/shared-tree/treeCheckout.js +2 -4
  70. package/dist/shared-tree/treeCheckout.js.map +1 -1
  71. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
  72. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  73. package/dist/shared-tree-core/editManagerCodecsCommons.js +2 -2
  74. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  75. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
  76. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  77. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +1 -1
  78. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  79. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  80. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  81. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +1 -1
  82. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  83. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  84. package/dist/shared-tree-core/messageCodecs.js +2 -2
  85. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  86. package/dist/simple-tree/api/index.d.ts +1 -1
  87. package/dist/simple-tree/api/index.d.ts.map +1 -1
  88. package/dist/simple-tree/api/index.js +2 -2
  89. package/dist/simple-tree/api/index.js.map +1 -1
  90. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
  91. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  92. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +180 -99
  93. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  94. package/dist/simple-tree/api/tree.d.ts +1 -1
  95. package/dist/simple-tree/api/tree.js.map +1 -1
  96. package/dist/simple-tree/api/treeBeta.d.ts +1 -1
  97. package/dist/simple-tree/api/treeBeta.js.map +1 -1
  98. package/dist/simple-tree/core/allowedTypes.d.ts +1 -1
  99. package/dist/simple-tree/core/allowedTypes.js.map +1 -1
  100. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +1 -0
  101. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  102. package/dist/simple-tree/core/unhydratedFlexTree.js +29 -0
  103. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  104. package/dist/simple-tree/index.d.ts +1 -1
  105. package/dist/simple-tree/index.d.ts.map +1 -1
  106. package/dist/simple-tree/index.js +2 -2
  107. package/dist/simple-tree/index.js.map +1 -1
  108. package/dist/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  109. package/dist/simple-tree/node-kinds/array/arrayNode.js +4 -13
  110. package/dist/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  111. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  112. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js +33 -7
  113. package/dist/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  114. package/dist/text/textDomainFormatted.d.ts +3 -3
  115. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  116. package/dist/text/textDomainFormatted.js +48 -32
  117. package/dist/text/textDomainFormatted.js.map +1 -1
  118. package/dist/util/bTreeUtils.d.ts.map +1 -1
  119. package/dist/util/bTreeUtils.js +6 -6
  120. package/dist/util/bTreeUtils.js.map +1 -1
  121. package/dist/util/rangeMap.d.ts.map +1 -1
  122. package/dist/util/rangeMap.js +5 -6
  123. package/dist/util/rangeMap.js.map +1 -1
  124. package/lib/alpha.d.ts +3 -3
  125. package/lib/beta.d.ts +1 -0
  126. package/lib/codec/codec.d.ts +3 -39
  127. package/lib/codec/codec.d.ts.map +1 -1
  128. package/lib/codec/codec.js +4 -47
  129. package/lib/codec/codec.js.map +1 -1
  130. package/lib/codec/index.d.ts +1 -1
  131. package/lib/codec/index.d.ts.map +1 -1
  132. package/lib/codec/index.js +1 -1
  133. package/lib/codec/index.js.map +1 -1
  134. package/lib/codec/versioned/codec.d.ts +20 -7
  135. package/lib/codec/versioned/codec.d.ts.map +1 -1
  136. package/lib/codec/versioned/codec.js +59 -33
  137. package/lib/codec/versioned/codec.js.map +1 -1
  138. package/lib/core/tree/detachedFieldIndexCodecs.d.ts.map +1 -1
  139. package/lib/core/tree/detachedFieldIndexCodecs.js +6 -4
  140. package/lib/core/tree/detachedFieldIndexCodecs.js.map +1 -1
  141. package/lib/extensibleUnionNode.d.ts +97 -0
  142. package/lib/extensibleUnionNode.d.ts.map +1 -0
  143. package/lib/{extensibleSchemaUnion.js → extensibleUnionNode.js} +28 -18
  144. package/lib/extensibleUnionNode.js.map +1 -0
  145. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +1 -1
  146. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  147. package/lib/feature-libraries/chunked-forest/codec/codecs.js +5 -5
  148. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  149. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  150. package/lib/feature-libraries/forest-summary/codec.js +8 -2
  151. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  152. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +3 -3
  153. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  154. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  155. package/lib/feature-libraries/forest-summary/formatV1.d.ts +2 -3
  156. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +1 -1
  157. package/lib/feature-libraries/forest-summary/formatV1.js +1 -2
  158. package/lib/feature-libraries/forest-summary/formatV1.js.map +1 -1
  159. package/lib/feature-libraries/forest-summary/formatV2.d.ts +2 -3
  160. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +1 -1
  161. package/lib/feature-libraries/forest-summary/formatV2.js +1 -2
  162. package/lib/feature-libraries/forest-summary/formatV2.js.map +1 -1
  163. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts +2 -2
  164. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.d.ts.map +1 -1
  165. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js +4 -4
  166. package/lib/feature-libraries/modular-schema/modularChangeCodecV1.js.map +1 -1
  167. package/lib/feature-libraries/schema-index/codec.d.ts.map +1 -1
  168. package/lib/feature-libraries/schema-index/codec.js +6 -4
  169. package/lib/feature-libraries/schema-index/codec.js.map +1 -1
  170. package/lib/index.d.ts +2 -2
  171. package/lib/index.d.ts.map +1 -1
  172. package/lib/index.js +2 -2
  173. package/lib/index.js.map +1 -1
  174. package/lib/legacy.d.ts +1 -0
  175. package/lib/packageVersion.d.ts +1 -1
  176. package/lib/packageVersion.js +1 -1
  177. package/lib/packageVersion.js.map +1 -1
  178. package/lib/shared-tree/sharedTreeChangeCodecs.js +1 -1
  179. package/lib/shared-tree/sharedTreeChangeCodecs.js.map +1 -1
  180. package/lib/shared-tree/tree.d.ts +1 -1
  181. package/lib/shared-tree/tree.js.map +1 -1
  182. package/lib/shared-tree/treeAlpha.d.ts +1 -1
  183. package/lib/shared-tree/treeAlpha.js.map +1 -1
  184. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  185. package/lib/shared-tree/treeCheckout.js +2 -4
  186. package/lib/shared-tree/treeCheckout.js.map +1 -1
  187. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +3 -3
  188. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  189. package/lib/shared-tree-core/editManagerCodecsCommons.js +2 -2
  190. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  191. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts +2 -2
  192. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  193. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +2 -2
  194. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  195. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts +2 -2
  196. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  197. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
  198. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  199. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  200. package/lib/shared-tree-core/messageCodecs.js +2 -2
  201. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  202. package/lib/simple-tree/api/index.d.ts +1 -1
  203. package/lib/simple-tree/api/index.d.ts.map +1 -1
  204. package/lib/simple-tree/api/index.js +1 -1
  205. package/lib/simple-tree/api/index.js.map +1 -1
  206. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +148 -29
  207. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts.map +1 -1
  208. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +179 -98
  209. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  210. package/lib/simple-tree/api/tree.d.ts +1 -1
  211. package/lib/simple-tree/api/tree.js.map +1 -1
  212. package/lib/simple-tree/api/treeBeta.d.ts +1 -1
  213. package/lib/simple-tree/api/treeBeta.js.map +1 -1
  214. package/lib/simple-tree/core/allowedTypes.d.ts +1 -1
  215. package/lib/simple-tree/core/allowedTypes.js.map +1 -1
  216. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +1 -0
  217. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  218. package/lib/simple-tree/core/unhydratedFlexTree.js +29 -0
  219. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  220. package/lib/simple-tree/index.d.ts +1 -1
  221. package/lib/simple-tree/index.d.ts.map +1 -1
  222. package/lib/simple-tree/index.js +1 -1
  223. package/lib/simple-tree/index.js.map +1 -1
  224. package/lib/simple-tree/node-kinds/array/arrayNode.d.ts.map +1 -1
  225. package/lib/simple-tree/node-kinds/array/arrayNode.js +5 -14
  226. package/lib/simple-tree/node-kinds/array/arrayNode.js.map +1 -1
  227. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.d.ts.map +1 -1
  228. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js +34 -8
  229. package/lib/simple-tree/unhydratedFlexTreeFromInsertable.js.map +1 -1
  230. package/lib/text/textDomainFormatted.d.ts +3 -3
  231. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  232. package/lib/text/textDomainFormatted.js +30 -14
  233. package/lib/text/textDomainFormatted.js.map +1 -1
  234. package/lib/util/bTreeUtils.d.ts.map +1 -1
  235. package/lib/util/bTreeUtils.js +6 -6
  236. package/lib/util/bTreeUtils.js.map +1 -1
  237. package/lib/util/rangeMap.d.ts.map +1 -1
  238. package/lib/util/rangeMap.js +5 -6
  239. package/lib/util/rangeMap.js.map +1 -1
  240. package/package.json +23 -23
  241. package/src/codec/codec.ts +10 -112
  242. package/src/codec/index.ts +0 -3
  243. package/src/codec/versioned/codec.ts +119 -83
  244. package/src/core/tree/detachedFieldIndexCodecs.ts +6 -4
  245. package/src/{extensibleSchemaUnion.ts → extensibleUnionNode.ts} +61 -19
  246. package/src/feature-libraries/chunked-forest/codec/codecs.ts +5 -11
  247. package/src/feature-libraries/forest-summary/codec.ts +8 -7
  248. package/src/feature-libraries/forest-summary/formatCommon.ts +5 -3
  249. package/src/feature-libraries/forest-summary/formatV1.ts +1 -3
  250. package/src/feature-libraries/forest-summary/formatV2.ts +1 -3
  251. package/src/feature-libraries/modular-schema/modularChangeCodecV1.ts +5 -6
  252. package/src/feature-libraries/schema-index/codec.ts +6 -4
  253. package/src/index.ts +3 -3
  254. package/src/packageVersion.ts +1 -1
  255. package/src/shared-tree/sharedTreeChangeCodecs.ts +2 -2
  256. package/src/shared-tree/tree.ts +1 -1
  257. package/src/shared-tree/treeAlpha.ts +1 -1
  258. package/src/shared-tree/treeCheckout.ts +2 -4
  259. package/src/shared-tree-core/editManagerCodecsCommons.ts +7 -7
  260. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +3 -10
  261. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +3 -10
  262. package/src/shared-tree-core/messageCodecs.ts +2 -6
  263. package/src/simple-tree/api/index.ts +2 -2
  264. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +344 -142
  265. package/src/simple-tree/api/tree.ts +1 -1
  266. package/src/simple-tree/api/treeBeta.ts +1 -1
  267. package/src/simple-tree/core/allowedTypes.ts +1 -1
  268. package/src/simple-tree/core/unhydratedFlexTree.ts +43 -1
  269. package/src/simple-tree/index.ts +2 -2
  270. package/src/simple-tree/node-kinds/array/arrayNode.ts +13 -19
  271. package/src/simple-tree/unhydratedFlexTreeFromInsertable.ts +51 -10
  272. package/src/text/textDomainFormatted.ts +37 -17
  273. package/src/util/bTreeUtils.ts +10 -6
  274. package/src/util/rangeMap.ts +9 -6
  275. package/api-extractor-lint.json +0 -4
  276. package/dist/extensibleSchemaUnion.d.ts +0 -72
  277. package/dist/extensibleSchemaUnion.d.ts.map +0 -1
  278. package/dist/extensibleSchemaUnion.js.map +0 -1
  279. package/lib/extensibleSchemaUnion.d.ts +0 -72
  280. package/lib/extensibleSchemaUnion.d.ts.map +0 -1
  281. package/lib/extensibleSchemaUnion.js.map +0 -1
@@ -9,7 +9,6 @@ import type { TAnySchema } from "@sinclair/typebox";
9
9
  import {
10
10
  type ICodecOptions,
11
11
  type IJsonCodec,
12
- type IMultiFormatCodec,
13
12
  type SchemaValidationFunction,
14
13
  extractJsonValidator,
15
14
  withSchemaValidation,
@@ -72,7 +71,7 @@ type ModularChangeCodec = IJsonCodec<
72
71
  ChangeEncodingContext
73
72
  >;
74
73
 
75
- type FieldCodec = IMultiFormatCodec<
74
+ type FieldCodec = IJsonCodec<
76
75
  FieldChangeset,
77
76
  JsonCompatibleReadOnly,
78
77
  JsonCompatibleReadOnly,
@@ -132,7 +131,7 @@ export function encodeFieldChangesForJsonI(
132
131
  fieldChange.fieldKind,
133
132
  fieldChangesetCodecs,
134
133
  );
135
- const encodedChange = codec.json.encode(fieldChange.change, context);
134
+ const encodedChange = codec.encode(fieldChange.change, context);
136
135
  if (compiledSchema !== undefined && !compiledSchema.check(encodedChange)) {
137
136
  fail(0xb1f /* Encoded change didn't pass schema validation. */);
138
137
  }
@@ -225,7 +224,7 @@ export function decodeFieldChangesFromJson(
225
224
  },
226
225
  };
227
226
 
228
- const fieldChangeset = codec.json.decode(field.change, fieldContext);
227
+ const fieldChangeset = codec.decode(field.change, fieldContext);
229
228
 
230
229
  const crossFieldKeys = getChangeHandler(fieldKinds, field.fieldKind).getCrossFieldKeys(
231
230
  fieldChangeset,
@@ -597,8 +596,8 @@ export function getFieldChangesetCodecs(
597
596
  const codec = kind.changeHandler.codecsFactory(revisionTagCodec).resolve(formatVersion);
598
597
  return {
599
598
  codec,
600
- compiledSchema: codec.json.encodedSchema
601
- ? extractJsonValidator(codecOptions.jsonValidator).compile(codec.json.encodedSchema)
599
+ compiledSchema: codec.encodedSchema
600
+ ? extractJsonValidator(codecOptions.jsonValidator).compile(codec.encodedSchema)
602
601
  : undefined,
603
602
  };
604
603
  };
@@ -125,8 +125,9 @@ function decodeV2(f: FormatV2): TreeStoredSchema {
125
125
  /**
126
126
  * Creates a codec which performs synchronous monolithic encoding of schema content.
127
127
  */
128
- export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Schema", {
129
- [lowestMinVersionForCollab]: {
128
+ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Schema", [
129
+ {
130
+ minVersionForCollab: lowestMinVersionForCollab,
130
131
  formatVersion: SchemaFormatVersion.v1,
131
132
  codec: {
132
133
  encode: (data: TreeStoredSchema) => encodeRepoV1(data),
@@ -134,7 +135,8 @@ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Sc
134
135
  schema: FormatV1,
135
136
  },
136
137
  },
137
- [FluidClientVersion.v2_43]: {
138
+ {
139
+ minVersionForCollab: FluidClientVersion.v2_43,
138
140
  formatVersion: SchemaFormatVersion.v2,
139
141
  codec: {
140
142
  encode: (data: TreeStoredSchema) => encodeRepoV2(data),
@@ -142,4 +144,4 @@ export const schemaCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Sc
142
144
  schema: FormatV2,
143
145
  },
144
146
  },
145
- });
147
+ ]);
package/src/index.ts CHANGED
@@ -296,13 +296,13 @@ export {
296
296
  exportCompatibilitySchemaSnapshot,
297
297
  importCompatibilitySchemaSnapshot,
298
298
  checkCompatibility,
299
- checkSchemaCompatibilitySnapshots,
299
+ snapshotSchemaCompatibility,
300
300
  type SnapshotFileSystem,
301
301
  incrementalSummaryHint,
302
302
  incrementalEncodingPolicyForAllowedTypes,
303
303
  eraseSchemaDetails,
304
304
  eraseSchemaDetailsSubclassable,
305
- type SchemaCompatibilitySnapshotsOptions,
305
+ type SnapshotSchemaCompatibilityOptions,
306
306
  type ArrayPlaceAnchor,
307
307
  createArrayInsertionAnchor,
308
308
  } from "./simple-tree/index.js";
@@ -371,4 +371,4 @@ export { TableSchema, type System_TableSchema } from "./tableSchema.js";
371
371
  export { asAlpha, asBeta } from "./api.js";
372
372
 
373
373
  export { TextAsTree, FormattedTextAsTree } from "./text/index.js";
374
- export { ExtensibleSchemaUnion } from "./extensibleSchemaUnion.js";
374
+ export { ExtensibleUnionNode } from "./extensibleUnionNode.js";
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tree";
9
- export const pkgVersion = "2.82.0";
9
+ export const pkgVersion = "2.83.0";
@@ -61,8 +61,8 @@ export function makeSharedTreeChangeCodecFamily(
61
61
  ([format, { modularChange, schemaChange }]) => [
62
62
  format,
63
63
  makeSharedTreeChangeCodec(
64
- modularChangeCodecFamily.resolve(modularChange).json,
65
- schemaChangeCodecs.resolve(schemaChange).json,
64
+ modularChangeCodecFamily.resolve(modularChange),
65
+ schemaChangeCodecs.resolve(schemaChange),
66
66
  options,
67
67
  ),
68
68
  ],
@@ -28,7 +28,7 @@ import type { ITreeCheckout } from "./treeCheckout.js";
28
28
  * Provides various functions for interacting with {@link TreeNode}s.
29
29
  * @remarks
30
30
  * This type should only be used via the {@link (Tree:variable)} export.
31
- * @system @sealed @public
31
+ * @sealed @public
32
32
  */
33
33
  export interface Tree extends TreeNodeApi {
34
34
  /**
@@ -226,7 +226,7 @@ export interface TreeIdentifierUtils {
226
226
  * There should be a way to provide a source for defaulted identifiers for unhydrated node creation, either via these APIs or some way to add them to its output later.
227
227
  * If an option were added to these APIs, it could also be used to enable unknown optional fields.
228
228
  *
229
- * @system @sealed @alpha
229
+ * @sealed @alpha
230
230
  */
231
231
  export interface TreeAlpha {
232
232
  /**
@@ -597,9 +597,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
597
597
  originatorId: this.idCompressor.localSessionId,
598
598
  revision,
599
599
  };
600
- const encodedChange = this.changeFamily.codecs
601
- .resolve(4)
602
- .json.encode(change, context);
600
+ const encodedChange = this.changeFamily.codecs.resolve(4).encode(change, context);
603
601
 
604
602
  assert(
605
603
  commit.parent !== undefined,
@@ -666,7 +664,7 @@ export class TreeCheckout implements ITreeCheckoutFork {
666
664
  originatorId: this.idCompressor.localSessionId,
667
665
  revision,
668
666
  };
669
- const decodedChange = this.changeFamily.codecs.resolve(4).json.decode(change, context);
667
+ const decodedChange = this.changeFamily.codecs.resolve(4).decode(change, context);
670
668
  this.applyChange(decodedChange, revision);
671
669
  }
672
670
 
@@ -6,7 +6,7 @@
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import type { IIdCompressor, SessionId } from "@fluidframework/id-compressor";
8
8
 
9
- import type { IJsonCodec, IMultiFormatCodec } from "../codec/index.js";
9
+ import type { IJsonCodec } from "../codec/index.js";
10
10
  import type {
11
11
  ChangeEncodingContext,
12
12
  EncodedRevisionTag,
@@ -32,7 +32,7 @@ export interface EditManagerEncodingContext {
32
32
 
33
33
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
34
34
  function encodeCommit<TChangeset, T extends Commit<TChangeset>>(
35
- changeCodec: IMultiFormatCodec<
35
+ changeCodec: IJsonCodec<
36
36
  TChangeset,
37
37
  JsonCompatibleReadOnly,
38
38
  JsonCompatibleReadOnly,
@@ -54,13 +54,13 @@ function encodeCommit<TChangeset, T extends Commit<TChangeset>>(
54
54
  idCompressor: context.idCompressor,
55
55
  revision: undefined,
56
56
  }),
57
- change: changeCodec.json.encode(commit.change, { ...context, revision: commit.revision }),
57
+ change: changeCodec.encode(commit.change, { ...context, revision: commit.revision }),
58
58
  };
59
59
  }
60
60
 
61
61
  // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
62
62
  function decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly>>(
63
- changeCodec: IMultiFormatCodec<
63
+ changeCodec: IJsonCodec<
64
64
  TChangeset,
65
65
  JsonCompatibleReadOnly,
66
66
  JsonCompatibleReadOnly,
@@ -84,12 +84,12 @@ function decodeCommit<TChangeset, T extends EncodedCommit<JsonCompatibleReadOnly
84
84
  return {
85
85
  ...commit,
86
86
  revision,
87
- change: changeCodec.json.decode(commit.change, { ...context, revision }),
87
+ change: changeCodec.decode(commit.change, { ...context, revision }),
88
88
  };
89
89
  }
90
90
 
91
91
  export function encodeSharedBranch<TChangeset>(
92
- changeCodec: IMultiFormatCodec<
92
+ changeCodec: IJsonCodec<
93
93
  TChangeset,
94
94
  JsonCompatibleReadOnly,
95
95
  JsonCompatibleReadOnly,
@@ -160,7 +160,7 @@ export function encodeSharedBranch<TChangeset>(
160
160
  }
161
161
 
162
162
  export function decodeSharedBranch<TChangeset>(
163
- changeCodec: IMultiFormatCodec<
163
+ changeCodec: IJsonCodec<
164
164
  TChangeset,
165
165
  JsonCompatibleReadOnly,
166
166
  JsonCompatibleReadOnly,
@@ -5,12 +5,7 @@
5
5
 
6
6
  import type { IIdCompressor } from "@fluidframework/id-compressor";
7
7
 
8
- import {
9
- type ICodecOptions,
10
- type IJsonCodec,
11
- type IMultiFormatCodec,
12
- withSchemaValidation,
13
- } from "../codec/index.js";
8
+ import { type ICodecOptions, type IJsonCodec, withSchemaValidation } from "../codec/index.js";
14
9
  import type {
15
10
  ChangeEncodingContext,
16
11
  EncodedRevisionTag,
@@ -29,7 +24,7 @@ export interface EditManagerEncodingContext {
29
24
  }
30
25
 
31
26
  export function makeV1CodecWithVersion<TChangeset>(
32
- changeCodec: IMultiFormatCodec<
27
+ changeCodec: IJsonCodec<
33
28
  TChangeset,
34
29
  JsonCompatibleReadOnly,
35
30
  JsonCompatibleReadOnly,
@@ -49,9 +44,7 @@ export function makeV1CodecWithVersion<TChangeset>(
49
44
  JsonCompatibleReadOnly,
50
45
  EditManagerEncodingContext
51
46
  > {
52
- const format = EncodedEditManager(
53
- changeCodec.json.encodedSchema ?? JsonCompatibleReadOnlySchema,
54
- );
47
+ const format = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
55
48
 
56
49
  const codec: IJsonCodec<
57
50
  SummaryData<TChangeset>,
@@ -6,12 +6,7 @@
6
6
  import { assert } from "@fluidframework/core-utils/internal";
7
7
  import type { IIdCompressor } from "@fluidframework/id-compressor";
8
8
 
9
- import {
10
- type ICodecOptions,
11
- type IJsonCodec,
12
- type IMultiFormatCodec,
13
- withSchemaValidation,
14
- } from "../codec/index.js";
9
+ import { type ICodecOptions, type IJsonCodec, withSchemaValidation } from "../codec/index.js";
15
10
  import type {
16
11
  ChangeEncodingContext,
17
12
  EncodedRevisionTag,
@@ -36,7 +31,7 @@ export interface EditManagerEncodingContext {
36
31
  }
37
32
 
38
33
  export function makeSharedBranchesCodecWithVersion<TChangeset>(
39
- changeCodec: IMultiFormatCodec<
34
+ changeCodec: IJsonCodec<
40
35
  TChangeset,
41
36
  JsonCompatibleReadOnly,
42
37
  JsonCompatibleReadOnly,
@@ -56,9 +51,7 @@ export function makeSharedBranchesCodecWithVersion<TChangeset>(
56
51
  JsonCompatibleReadOnly,
57
52
  EditManagerEncodingContext
58
53
  > {
59
- const format = EncodedEditManager(
60
- changeCodec.json.encodedSchema ?? JsonCompatibleReadOnlySchema,
61
- );
54
+ const format = EncodedEditManager(changeCodec.encodedSchema ?? JsonCompatibleReadOnlySchema);
62
55
 
63
56
  const codec: IJsonCodec<
64
57
  SummaryData<TChangeset>,
@@ -146,9 +146,7 @@ export function makeMessageCodecs<TChangeset>(
146
146
  case unbrand(MessageFormatVersion.v3):
147
147
  case unbrand(MessageFormatVersion.v4):
148
148
  case unbrand(MessageFormatVersion.v6): {
149
- const changeCodec = changeCodecs.resolve(
150
- dependentChangeFormatVersion.lookup(version),
151
- ).json;
149
+ const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
152
150
  return [
153
151
  version,
154
152
  makeV1ToV4CodecWithVersion(changeCodec, revisionTagCodec, options, version),
@@ -158,9 +156,7 @@ export function makeMessageCodecs<TChangeset>(
158
156
  return [version, makeDiscontinuedCodecVersion(options, version, "2.74.0")];
159
157
  }
160
158
  case unbrand(MessageFormatVersion.vSharedBranches): {
161
- const changeCodec = changeCodecs.resolve(
162
- dependentChangeFormatVersion.lookup(version),
163
- ).json;
159
+ const changeCodec = changeCodecs.resolve(dependentChangeFormatVersion.lookup(version));
164
160
  return [
165
161
  version,
166
162
  makeSharedBranchesCodecWithVersion(changeCodec, revisionTagCodec, options, version),
@@ -181,7 +181,7 @@ export {
181
181
  exportCompatibilitySchemaSnapshot,
182
182
  importCompatibilitySchemaSnapshot,
183
183
  checkCompatibility,
184
- checkSchemaCompatibilitySnapshots,
184
+ snapshotSchemaCompatibility,
185
185
  type SnapshotFileSystem,
186
- type SchemaCompatibilitySnapshotsOptions,
186
+ type SnapshotSchemaCompatibilityOptions,
187
187
  } from "./snapshotCompatibilityChecker.js";