@fluidframework/tree 2.83.0 → 2.90.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 (412) hide show
  1. package/.vscode/settings.json +6 -5
  2. package/CHANGELOG.md +95 -0
  3. package/README.md +1 -1
  4. package/api-report/tree.alpha.api.md +63 -24
  5. package/api-report/tree.beta.api.md +30 -0
  6. package/api-report/tree.legacy.beta.api.md +30 -0
  7. package/dist/alpha.d.ts +10 -6
  8. package/dist/beta.d.ts +4 -1
  9. package/dist/codec/codec.d.ts +2 -0
  10. package/dist/codec/codec.d.ts.map +1 -1
  11. package/dist/codec/codec.js +4 -3
  12. package/dist/codec/codec.js.map +1 -1
  13. package/dist/codec/index.d.ts +1 -1
  14. package/dist/codec/index.d.ts.map +1 -1
  15. package/dist/codec/index.js +2 -1
  16. package/dist/codec/index.js.map +1 -1
  17. package/dist/codec/versioned/codec.d.ts +13 -1
  18. package/dist/codec/versioned/codec.d.ts.map +1 -1
  19. package/dist/codec/versioned/codec.js +18 -3
  20. package/dist/codec/versioned/codec.js.map +1 -1
  21. package/dist/codec/versioned/format.d.ts +22 -1
  22. package/dist/codec/versioned/format.d.ts.map +1 -1
  23. package/dist/codec/versioned/format.js +16 -3
  24. package/dist/codec/versioned/format.js.map +1 -1
  25. package/dist/codec/versioned/index.d.ts +1 -1
  26. package/dist/codec/versioned/index.d.ts.map +1 -1
  27. package/dist/codec/versioned/index.js +2 -1
  28. package/dist/codec/versioned/index.js.map +1 -1
  29. package/dist/core/index.d.ts +1 -2
  30. package/dist/core/index.d.ts.map +1 -1
  31. package/dist/core/index.js +1 -3
  32. package/dist/core/index.js.map +1 -1
  33. package/dist/core/rebase/index.d.ts +1 -1
  34. package/dist/core/rebase/index.d.ts.map +1 -1
  35. package/dist/core/rebase/index.js.map +1 -1
  36. package/dist/core/rebase/types.d.ts +78 -0
  37. package/dist/core/rebase/types.d.ts.map +1 -1
  38. package/dist/core/rebase/types.js.map +1 -1
  39. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  40. package/dist/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  41. package/dist/feature-libraries/chunked-forest/codec/codecs.js +22 -44
  42. package/dist/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  43. package/dist/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  44. package/dist/feature-libraries/chunked-forest/codec/format.js +11 -0
  45. package/dist/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  46. package/dist/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  47. package/dist/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  48. package/dist/feature-libraries/chunked-forest/codec/index.js +2 -4
  49. package/dist/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  50. package/dist/feature-libraries/chunked-forest/index.d.ts +1 -1
  51. package/dist/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  52. package/dist/feature-libraries/chunked-forest/index.js +2 -4
  53. package/dist/feature-libraries/chunked-forest/index.js.map +1 -1
  54. package/dist/feature-libraries/flex-tree/observer.d.ts +17 -0
  55. package/dist/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  56. package/dist/feature-libraries/flex-tree/observer.js.map +1 -1
  57. package/dist/feature-libraries/forest-summary/codec.d.ts +5 -12
  58. package/dist/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  59. package/dist/feature-libraries/forest-summary/codec.js +33 -33
  60. package/dist/feature-libraries/forest-summary/codec.js.map +1 -1
  61. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  62. package/dist/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  63. package/dist/feature-libraries/forest-summary/forestSummarizer.js +6 -7
  64. package/dist/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  65. package/dist/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  66. package/dist/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  67. package/dist/feature-libraries/forest-summary/formatCommon.js +13 -11
  68. package/dist/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  69. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  70. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  71. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js +31 -48
  72. package/dist/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  73. package/dist/feature-libraries/forest-summary/index.d.ts +1 -1
  74. package/dist/feature-libraries/forest-summary/index.d.ts.map +1 -1
  75. package/dist/feature-libraries/forest-summary/index.js +2 -2
  76. package/dist/feature-libraries/forest-summary/index.js.map +1 -1
  77. package/dist/feature-libraries/index.d.ts +3 -3
  78. package/dist/feature-libraries/index.d.ts.map +1 -1
  79. package/dist/feature-libraries/index.js +4 -5
  80. package/dist/feature-libraries/index.js.map +1 -1
  81. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  82. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  83. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  84. package/dist/feature-libraries/indexing/index.d.ts +1 -1
  85. package/dist/feature-libraries/indexing/index.d.ts.map +1 -1
  86. package/dist/feature-libraries/indexing/index.js.map +1 -1
  87. package/dist/feature-libraries/indexing/types.d.ts +15 -13
  88. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  89. package/dist/feature-libraries/indexing/types.js.map +1 -1
  90. package/dist/index.d.ts +3 -3
  91. package/dist/index.d.ts.map +1 -1
  92. package/dist/index.js +2 -2
  93. package/dist/index.js.map +1 -1
  94. package/dist/legacy.d.ts +4 -1
  95. package/dist/packageVersion.d.ts +1 -1
  96. package/dist/packageVersion.js +1 -1
  97. package/dist/packageVersion.js.map +1 -1
  98. package/dist/shared-tree/independentView.js +2 -2
  99. package/dist/shared-tree/independentView.js.map +1 -1
  100. package/dist/shared-tree/schematizingTreeView.d.ts +5 -0
  101. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  102. package/dist/shared-tree/schematizingTreeView.js +35 -7
  103. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  104. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  105. package/dist/shared-tree/sharedTree.js +7 -7
  106. package/dist/shared-tree/sharedTree.js.map +1 -1
  107. package/dist/shared-tree/tree.js +1 -1
  108. package/dist/shared-tree/tree.js.map +1 -1
  109. package/dist/shared-tree/treeAlpha.d.ts +8 -1
  110. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  111. package/dist/shared-tree/treeAlpha.js +48 -8
  112. package/dist/shared-tree/treeAlpha.js.map +1 -1
  113. package/dist/shared-tree/treeCheckout.d.ts +35 -3
  114. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  115. package/dist/shared-tree/treeCheckout.js +123 -17
  116. package/dist/shared-tree/treeCheckout.js.map +1 -1
  117. package/dist/shared-tree/unhydratedTreeContext.d.ts +20 -0
  118. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  119. package/dist/shared-tree/unhydratedTreeContext.js +56 -0
  120. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -0
  121. package/dist/shared-tree-core/transaction.d.ts +15 -27
  122. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  123. package/dist/shared-tree-core/transaction.js +7 -11
  124. package/dist/shared-tree-core/transaction.js.map +1 -1
  125. package/dist/simple-tree/api/configuration.d.ts +4 -0
  126. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  127. package/dist/simple-tree/api/configuration.js.map +1 -1
  128. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  129. package/dist/simple-tree/api/identifierIndex.d.ts.map +1 -1
  130. package/dist/simple-tree/api/identifierIndex.js +1 -1
  131. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  132. package/dist/simple-tree/api/index.d.ts +3 -3
  133. package/dist/simple-tree/api/index.d.ts.map +1 -1
  134. package/dist/simple-tree/api/index.js +2 -2
  135. package/dist/simple-tree/api/index.js.map +1 -1
  136. package/dist/simple-tree/api/schemaFactory.d.ts +3 -2
  137. package/dist/simple-tree/api/schemaFactory.d.ts.map +1 -1
  138. package/dist/simple-tree/api/schemaFactory.js +3 -2
  139. package/dist/simple-tree/api/schemaFactory.js.map +1 -1
  140. package/dist/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  141. package/dist/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  142. package/dist/simple-tree/api/simpleTreeIndex.js +4 -4
  143. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  144. package/dist/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  145. package/dist/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  146. package/dist/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  147. package/dist/simple-tree/api/transactionTypes.d.ts +22 -25
  148. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  149. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  150. package/dist/simple-tree/api/tree.d.ts +69 -132
  151. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  152. package/dist/simple-tree/api/tree.js.map +1 -1
  153. package/dist/simple-tree/index.d.ts +1 -1
  154. package/dist/simple-tree/index.d.ts.map +1 -1
  155. package/dist/simple-tree/index.js +2 -2
  156. package/dist/simple-tree/index.js.map +1 -1
  157. package/dist/text/textDomain.d.ts +27 -9
  158. package/dist/text/textDomain.d.ts.map +1 -1
  159. package/dist/text/textDomain.js +43 -7
  160. package/dist/text/textDomain.js.map +1 -1
  161. package/dist/text/textDomainFormatted.d.ts +14 -8
  162. package/dist/text/textDomainFormatted.d.ts.map +1 -1
  163. package/dist/text/textDomainFormatted.js +97 -25
  164. package/dist/text/textDomainFormatted.js.map +1 -1
  165. package/dist/util/rangeMap.d.ts +1 -0
  166. package/dist/util/rangeMap.d.ts.map +1 -1
  167. package/dist/util/rangeMap.js +5 -6
  168. package/dist/util/rangeMap.js.map +1 -1
  169. package/lib/alpha.d.ts +10 -6
  170. package/lib/beta.d.ts +4 -1
  171. package/lib/codec/codec.d.ts +2 -0
  172. package/lib/codec/codec.d.ts.map +1 -1
  173. package/lib/codec/codec.js +4 -3
  174. package/lib/codec/codec.js.map +1 -1
  175. package/lib/codec/index.d.ts +1 -1
  176. package/lib/codec/index.d.ts.map +1 -1
  177. package/lib/codec/index.js +1 -1
  178. package/lib/codec/index.js.map +1 -1
  179. package/lib/codec/versioned/codec.d.ts +13 -1
  180. package/lib/codec/versioned/codec.d.ts.map +1 -1
  181. package/lib/codec/versioned/codec.js +18 -3
  182. package/lib/codec/versioned/codec.js.map +1 -1
  183. package/lib/codec/versioned/format.d.ts +22 -1
  184. package/lib/codec/versioned/format.d.ts.map +1 -1
  185. package/lib/codec/versioned/format.js +15 -2
  186. package/lib/codec/versioned/format.js.map +1 -1
  187. package/lib/codec/versioned/index.d.ts +1 -1
  188. package/lib/codec/versioned/index.d.ts.map +1 -1
  189. package/lib/codec/versioned/index.js +1 -1
  190. package/lib/codec/versioned/index.js.map +1 -1
  191. package/lib/core/index.d.ts +1 -2
  192. package/lib/core/index.d.ts.map +1 -1
  193. package/lib/core/index.js +0 -1
  194. package/lib/core/index.js.map +1 -1
  195. package/lib/core/rebase/index.d.ts +1 -1
  196. package/lib/core/rebase/index.d.ts.map +1 -1
  197. package/lib/core/rebase/index.js.map +1 -1
  198. package/lib/core/rebase/types.d.ts +78 -0
  199. package/lib/core/rebase/types.d.ts.map +1 -1
  200. package/lib/core/rebase/types.js.map +1 -1
  201. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts +8 -7
  202. package/lib/feature-libraries/chunked-forest/codec/codecs.d.ts.map +1 -1
  203. package/lib/feature-libraries/chunked-forest/codec/codecs.js +25 -45
  204. package/lib/feature-libraries/chunked-forest/codec/codecs.js.map +1 -1
  205. package/lib/feature-libraries/chunked-forest/codec/format.d.ts.map +1 -1
  206. package/lib/feature-libraries/chunked-forest/codec/format.js +11 -0
  207. package/lib/feature-libraries/chunked-forest/codec/format.js.map +1 -1
  208. package/lib/feature-libraries/chunked-forest/codec/index.d.ts +3 -2
  209. package/lib/feature-libraries/chunked-forest/codec/index.d.ts.map +1 -1
  210. package/lib/feature-libraries/chunked-forest/codec/index.js +2 -2
  211. package/lib/feature-libraries/chunked-forest/codec/index.js.map +1 -1
  212. package/lib/feature-libraries/chunked-forest/index.d.ts +1 -1
  213. package/lib/feature-libraries/chunked-forest/index.d.ts.map +1 -1
  214. package/lib/feature-libraries/chunked-forest/index.js +1 -1
  215. package/lib/feature-libraries/chunked-forest/index.js.map +1 -1
  216. package/lib/feature-libraries/flex-tree/observer.d.ts +17 -0
  217. package/lib/feature-libraries/flex-tree/observer.d.ts.map +1 -1
  218. package/lib/feature-libraries/flex-tree/observer.js.map +1 -1
  219. package/lib/feature-libraries/forest-summary/codec.d.ts +5 -12
  220. package/lib/feature-libraries/forest-summary/codec.d.ts.map +1 -1
  221. package/lib/feature-libraries/forest-summary/codec.js +35 -32
  222. package/lib/feature-libraries/forest-summary/codec.js.map +1 -1
  223. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts +2 -2
  224. package/lib/feature-libraries/forest-summary/forestSummarizer.d.ts.map +1 -1
  225. package/lib/feature-libraries/forest-summary/forestSummarizer.js +7 -8
  226. package/lib/feature-libraries/forest-summary/forestSummarizer.js.map +1 -1
  227. package/lib/feature-libraries/forest-summary/formatCommon.d.ts +6 -4
  228. package/lib/feature-libraries/forest-summary/formatCommon.d.ts.map +1 -1
  229. package/lib/feature-libraries/forest-summary/formatCommon.js +7 -4
  230. package/lib/feature-libraries/forest-summary/formatCommon.js.map +1 -1
  231. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts +19 -14
  232. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.d.ts.map +1 -1
  233. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js +30 -47
  234. package/lib/feature-libraries/forest-summary/incrementalSummaryBuilder.js.map +1 -1
  235. package/lib/feature-libraries/forest-summary/index.d.ts +1 -1
  236. package/lib/feature-libraries/forest-summary/index.d.ts.map +1 -1
  237. package/lib/feature-libraries/forest-summary/index.js +1 -1
  238. package/lib/feature-libraries/forest-summary/index.js.map +1 -1
  239. package/lib/feature-libraries/index.d.ts +3 -3
  240. package/lib/feature-libraries/index.d.ts.map +1 -1
  241. package/lib/feature-libraries/index.js +2 -2
  242. package/lib/feature-libraries/index.js.map +1 -1
  243. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +3 -3
  244. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  245. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  246. package/lib/feature-libraries/indexing/index.d.ts +1 -1
  247. package/lib/feature-libraries/indexing/index.d.ts.map +1 -1
  248. package/lib/feature-libraries/indexing/index.js.map +1 -1
  249. package/lib/feature-libraries/indexing/types.d.ts +15 -13
  250. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  251. package/lib/feature-libraries/indexing/types.js.map +1 -1
  252. package/lib/index.d.ts +3 -3
  253. package/lib/index.d.ts.map +1 -1
  254. package/lib/index.js +1 -1
  255. package/lib/index.js.map +1 -1
  256. package/lib/legacy.d.ts +4 -1
  257. package/lib/packageVersion.d.ts +1 -1
  258. package/lib/packageVersion.js +1 -1
  259. package/lib/packageVersion.js.map +1 -1
  260. package/lib/shared-tree/independentView.js +3 -3
  261. package/lib/shared-tree/independentView.js.map +1 -1
  262. package/lib/shared-tree/schematizingTreeView.d.ts +5 -0
  263. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  264. package/lib/shared-tree/schematizingTreeView.js +33 -6
  265. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  266. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  267. package/lib/shared-tree/sharedTree.js +8 -8
  268. package/lib/shared-tree/sharedTree.js.map +1 -1
  269. package/lib/shared-tree/tree.js +1 -1
  270. package/lib/shared-tree/tree.js.map +1 -1
  271. package/lib/shared-tree/treeAlpha.d.ts +8 -1
  272. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  273. package/lib/shared-tree/treeAlpha.js +49 -9
  274. package/lib/shared-tree/treeAlpha.js.map +1 -1
  275. package/lib/shared-tree/treeCheckout.d.ts +35 -3
  276. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  277. package/lib/shared-tree/treeCheckout.js +124 -18
  278. package/lib/shared-tree/treeCheckout.js.map +1 -1
  279. package/lib/shared-tree/unhydratedTreeContext.d.ts +20 -0
  280. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -0
  281. package/lib/shared-tree/unhydratedTreeContext.js +52 -0
  282. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -0
  283. package/lib/shared-tree-core/transaction.d.ts +15 -27
  284. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  285. package/lib/shared-tree-core/transaction.js +7 -11
  286. package/lib/shared-tree-core/transaction.js.map +1 -1
  287. package/lib/simple-tree/api/configuration.d.ts +4 -0
  288. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  289. package/lib/simple-tree/api/configuration.js.map +1 -1
  290. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  291. package/lib/simple-tree/api/identifierIndex.d.ts.map +1 -1
  292. package/lib/simple-tree/api/identifierIndex.js +2 -2
  293. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  294. package/lib/simple-tree/api/index.d.ts +3 -3
  295. package/lib/simple-tree/api/index.d.ts.map +1 -1
  296. package/lib/simple-tree/api/index.js +1 -1
  297. package/lib/simple-tree/api/index.js.map +1 -1
  298. package/lib/simple-tree/api/schemaFactory.d.ts +3 -2
  299. package/lib/simple-tree/api/schemaFactory.d.ts.map +1 -1
  300. package/lib/simple-tree/api/schemaFactory.js +3 -2
  301. package/lib/simple-tree/api/schemaFactory.js.map +1 -1
  302. package/lib/simple-tree/api/simpleTreeIndex.d.ts +15 -13
  303. package/lib/simple-tree/api/simpleTreeIndex.d.ts.map +1 -1
  304. package/lib/simple-tree/api/simpleTreeIndex.js +2 -2
  305. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  306. package/lib/simple-tree/api/snapshotCompatibilityChecker.d.ts +4 -4
  307. package/lib/simple-tree/api/snapshotCompatibilityChecker.js +2 -2
  308. package/lib/simple-tree/api/snapshotCompatibilityChecker.js.map +1 -1
  309. package/lib/simple-tree/api/transactionTypes.d.ts +22 -25
  310. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  311. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  312. package/lib/simple-tree/api/tree.d.ts +69 -132
  313. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  314. package/lib/simple-tree/api/tree.js.map +1 -1
  315. package/lib/simple-tree/index.d.ts +1 -1
  316. package/lib/simple-tree/index.d.ts.map +1 -1
  317. package/lib/simple-tree/index.js +1 -1
  318. package/lib/simple-tree/index.js.map +1 -1
  319. package/lib/text/textDomain.d.ts +27 -9
  320. package/lib/text/textDomain.d.ts.map +1 -1
  321. package/lib/text/textDomain.js +45 -9
  322. package/lib/text/textDomain.js.map +1 -1
  323. package/lib/text/textDomainFormatted.d.ts +14 -8
  324. package/lib/text/textDomainFormatted.d.ts.map +1 -1
  325. package/lib/text/textDomainFormatted.js +80 -8
  326. package/lib/text/textDomainFormatted.js.map +1 -1
  327. package/lib/util/rangeMap.d.ts +1 -0
  328. package/lib/util/rangeMap.d.ts.map +1 -1
  329. package/lib/util/rangeMap.js +5 -6
  330. package/lib/util/rangeMap.js.map +1 -1
  331. package/package.json +24 -24
  332. package/src/codec/codec.ts +5 -4
  333. package/src/codec/index.ts +1 -0
  334. package/src/codec/versioned/codec.ts +32 -6
  335. package/src/codec/versioned/format.ts +17 -2
  336. package/src/codec/versioned/index.ts +1 -1
  337. package/src/core/index.ts +2 -6
  338. package/src/core/rebase/index.ts +2 -0
  339. package/src/core/rebase/types.ts +80 -0
  340. package/src/feature-libraries/chunked-forest/codec/codecs.ts +59 -78
  341. package/src/feature-libraries/chunked-forest/codec/format.ts +11 -0
  342. package/src/feature-libraries/chunked-forest/codec/index.ts +3 -3
  343. package/src/feature-libraries/chunked-forest/index.ts +2 -3
  344. package/src/feature-libraries/flex-tree/observer.ts +17 -0
  345. package/src/feature-libraries/forest-summary/codec.ts +46 -56
  346. package/src/feature-libraries/forest-summary/forestSummarizer.ts +5 -14
  347. package/src/feature-libraries/forest-summary/formatCommon.ts +14 -19
  348. package/src/feature-libraries/forest-summary/incrementalSummaryBuilder.ts +44 -74
  349. package/src/feature-libraries/forest-summary/index.ts +1 -1
  350. package/src/feature-libraries/index.ts +2 -4
  351. package/src/feature-libraries/indexing/anchorTreeIndex.ts +3 -5
  352. package/src/feature-libraries/indexing/index.ts +1 -1
  353. package/src/feature-libraries/indexing/types.ts +15 -17
  354. package/src/index.ts +6 -3
  355. package/src/packageVersion.ts +1 -1
  356. package/src/shared-tree/independentView.ts +3 -3
  357. package/src/shared-tree/schematizingTreeView.ts +43 -10
  358. package/src/shared-tree/sharedTree.ts +8 -10
  359. package/src/shared-tree/tree.ts +1 -1
  360. package/src/shared-tree/treeAlpha.ts +64 -11
  361. package/src/shared-tree/treeCheckout.ts +142 -21
  362. package/src/shared-tree/unhydratedTreeContext.ts +87 -0
  363. package/src/shared-tree-core/transaction.ts +19 -39
  364. package/src/simple-tree/api/configuration.ts +4 -0
  365. package/src/simple-tree/api/identifierIndex.ts +4 -4
  366. package/src/simple-tree/api/index.ts +3 -1
  367. package/src/simple-tree/api/schemaFactory.ts +3 -2
  368. package/src/simple-tree/api/simpleTreeIndex.ts +26 -20
  369. package/src/simple-tree/api/snapshotCompatibilityChecker.ts +4 -4
  370. package/src/simple-tree/api/transactionTypes.ts +24 -26
  371. package/src/simple-tree/api/tree.ts +92 -131
  372. package/src/simple-tree/index.ts +4 -2
  373. package/src/text/textDomain.ts +91 -12
  374. package/src/text/textDomainFormatted.ts +127 -15
  375. package/src/util/rangeMap.ts +5 -11
  376. package/dist/core/schema-view/index.d.ts +0 -6
  377. package/dist/core/schema-view/index.d.ts.map +0 -1
  378. package/dist/core/schema-view/index.js +0 -10
  379. package/dist/core/schema-view/index.js.map +0 -1
  380. package/dist/core/schema-view/view.d.ts +0 -31
  381. package/dist/core/schema-view/view.d.ts.map +0 -1
  382. package/dist/core/schema-view/view.js +0 -18
  383. package/dist/core/schema-view/view.js.map +0 -1
  384. package/dist/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  385. package/dist/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  386. package/dist/feature-libraries/forest-summary/formatV1.js +0 -10
  387. package/dist/feature-libraries/forest-summary/formatV1.js.map +0 -1
  388. package/dist/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  389. package/dist/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  390. package/dist/feature-libraries/forest-summary/formatV2.js +0 -10
  391. package/dist/feature-libraries/forest-summary/formatV2.js.map +0 -1
  392. package/lib/core/schema-view/index.d.ts +0 -6
  393. package/lib/core/schema-view/index.d.ts.map +0 -1
  394. package/lib/core/schema-view/index.js +0 -6
  395. package/lib/core/schema-view/index.js.map +0 -1
  396. package/lib/core/schema-view/view.d.ts +0 -31
  397. package/lib/core/schema-view/view.d.ts.map +0 -1
  398. package/lib/core/schema-view/view.js +0 -14
  399. package/lib/core/schema-view/view.js.map +0 -1
  400. package/lib/feature-libraries/forest-summary/formatV1.d.ts +0 -12
  401. package/lib/feature-libraries/forest-summary/formatV1.d.ts.map +0 -1
  402. package/lib/feature-libraries/forest-summary/formatV1.js +0 -7
  403. package/lib/feature-libraries/forest-summary/formatV1.js.map +0 -1
  404. package/lib/feature-libraries/forest-summary/formatV2.d.ts +0 -12
  405. package/lib/feature-libraries/forest-summary/formatV2.d.ts.map +0 -1
  406. package/lib/feature-libraries/forest-summary/formatV2.js +0 -7
  407. package/lib/feature-libraries/forest-summary/formatV2.js.map +0 -1
  408. package/src/core/schema-view/README.md +0 -9
  409. package/src/core/schema-view/index.ts +0 -10
  410. package/src/core/schema-view/view.ts +0 -38
  411. package/src/feature-libraries/forest-summary/formatV1.ts +0 -11
  412. package/src/feature-libraries/forest-summary/formatV2.ts +0 -11
@@ -3,53 +3,20 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { assert, unreachableCase } from "@fluidframework/core-utils/internal";
6
- import { getConfigForMinVersionForCollab, lowestMinVersionForCollab, } from "@fluidframework/runtime-utils/internal";
7
- import { FluidClientVersion, makeVersionedValidatedCodec, } from "../../../codec/index.js";
8
- import { brand, brandedNumberType, unbrand, } from "../../../util/index.js";
6
+ import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/internal";
7
+ import { ClientVersionDispatchingCodecBuilder, FluidClientVersion, } from "../../../codec/index.js";
8
+ import { brandedNumberType } from "../../../util/index.js";
9
9
  import { TreeCompressionStrategy } from "../../treeCompressionUtils.js";
10
10
  import { decode } from "./chunkDecoding.js";
11
- import { EncodedFieldBatch, validVersions, FieldBatchFormatVersion } from "./format.js";
11
+ import { FieldBatchFormatVersion, EncodedFieldBatchV1, EncodedFieldBatchV2, } from "./format.js";
12
12
  import { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from "./schemaBasedEncode.js";
13
13
  import { uncompressedEncodeV1, uncompressedEncodeV2 } from "./uncompressedEncode.js";
14
14
  const ChunkReferenceId = brandedNumberType({ multipleOf: 1, minimum: 0 });
15
15
  /**
16
- * Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.
17
- * @param clientVersion - The MinimumVersionForCollab to convert.
16
+ * Creates the encode/decode functions for a specific FieldBatch format version.
18
17
  */
19
- function clientVersionToFieldBatchVersion(clientVersion) {
20
- return brand(getConfigForMinVersionForCollab(clientVersion, {
21
- [lowestMinVersionForCollab]: FieldBatchFormatVersion.v1,
22
- [FluidClientVersion.v2_73]: FieldBatchFormatVersion.v2,
23
- }));
24
- }
25
- export function makeFieldBatchCodec(options) {
26
- const writeVersion = clientVersionToFieldBatchVersion(options.minVersionForCollab);
27
- // Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since
28
- // the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if
29
- // decode is being run on a client that just submitted a schema change, but the op is from another client who has
30
- // yet to receive that change).
31
- assert(validVersions.has(writeVersion), 0x935 /* Invalid write version for FieldBatch codec */);
32
- let uncompressedEncodeFn;
33
- let schemaCompressedEncodeFn;
34
- switch (writeVersion) {
35
- case unbrand(FieldBatchFormatVersion.v1): {
36
- uncompressedEncodeFn = uncompressedEncodeV1;
37
- schemaCompressedEncodeFn = schemaCompressedEncodeV1;
38
- break;
39
- }
40
- case unbrand(FieldBatchFormatVersion.v2): {
41
- uncompressedEncodeFn = uncompressedEncodeV2;
42
- schemaCompressedEncodeFn = schemaCompressedEncodeV2;
43
- break;
44
- }
45
- default: {
46
- unreachableCase(writeVersion);
47
- }
48
- }
49
- // Both the encode and decode logic here support both v1 and v2, as does `validVersions` and `EncodedFieldBatch`.
50
- // This makes this use of makeVersionedValidatedCodec atypical as it is a single call being used to make a codec that supports all versions,
51
- // instead of one call per version, then using another utility to select between them based on version.
52
- return makeVersionedValidatedCodec(options, validVersions, EncodedFieldBatch, {
18
+ function makeFieldBatchCodecForVersion(version, uncompressedEncodeFn, schemaCompressedEncodeFn, encodedFieldBatchType) {
19
+ return {
53
20
  encode: (data, context) => {
54
21
  for (const cursor of data) {
55
22
  assert(cursor.mode === 1 /* CursorLocationType.Fields */, 0x8a3 /* FieldBatch expects fields cursors */);
@@ -62,7 +29,7 @@ export function makeFieldBatchCodec(options) {
62
29
  break;
63
30
  }
64
31
  case TreeCompressionStrategy.CompressedIncremental: {
65
- assert(writeVersion >= FieldBatchFormatVersion.v2, 0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */);
32
+ assert(version >= FieldBatchFormatVersion.v2, 0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */);
66
33
  // Incremental encoding is only supported for CompressedIncremental.
67
34
  incrementalEncoder = context.incrementalEncoderDecoder;
68
35
  }
@@ -92,9 +59,22 @@ export function makeFieldBatchCodec(options) {
92
59
  originatorId: context.originatorId,
93
60
  }, context.incrementalEncoderDecoder).map((chunk) => chunk.cursor());
94
61
  },
95
- });
96
- }
97
- export function getCodecTreeForFieldBatchFormat(clientVersion) {
98
- return { name: "FieldBatch", version: clientVersionToFieldBatchVersion(clientVersion) };
62
+ schema: encodedFieldBatchType,
63
+ };
99
64
  }
65
+ /**
66
+ * {@link ClientVersionDispatchingCodecBuilder} for field batch codecs.
67
+ */
68
+ export const fieldBatchCodecBuilder = ClientVersionDispatchingCodecBuilder.build("FieldBatch", [
69
+ {
70
+ minVersionForCollab: lowestMinVersionForCollab,
71
+ formatVersion: FieldBatchFormatVersion.v1,
72
+ codec: makeFieldBatchCodecForVersion(FieldBatchFormatVersion.v1, uncompressedEncodeV1, schemaCompressedEncodeV1, EncodedFieldBatchV1),
73
+ },
74
+ {
75
+ minVersionForCollab: FluidClientVersion.v2_73,
76
+ formatVersion: FieldBatchFormatVersion.v2,
77
+ codec: makeFieldBatchCodecForVersion(FieldBatchFormatVersion.v2, uncompressedEncodeV2, schemaCompressedEncodeV2, EncodedFieldBatchV2),
78
+ },
79
+ ]);
100
80
  //# sourceMappingURL=codecs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAG9E,OAAO,EACN,+BAA+B,EAC/B,yBAAyB,GACzB,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAGN,kBAAkB,EAElB,2BAA2B,GAC3B,MAAM,yBAAyB,CAAC;AAOjC,OAAO,EACN,KAAK,EACL,iBAAiB,EAGjB,OAAO,GACP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,uBAAuB,E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ACrB,OAAO,CAAC,MAAM,CAAC,MAAM,EACrB,IAAI,EACJ,OAAO,CAAC,YAAY,EACpB,kBAAkB,CAClB,CAAC;oBACH,CAAC;oBAED,MAAM;gBACP,CAAC;gBACD,OAAO,CAAC,CAAC,CAAC;oBACT,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBACrC,CAAC;YACF,CAAC;YAED,oDAAoD;YACpD,OAAO,OAAO,CAAC;QAChB,CAAC;QACD,MAAM,EAAE,CAAC,IAAuB,EAAE,OAAkC,EAAc,EAAE;YACnF,6CAA6C;YAC7C,OAAO,MAAM,CACZ,IAAI,EACJ;gBACC,YAAY,EAAE,OAAO,CAAC,YAAY;gBAClC,YAAY,EAAE,OAAO,CAAC,YAAY;aAClC,EACD,OAAO,CAAC,yBAAyB,CACjC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAClC,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,+BAA+B,CAC9C,aAAsC;IAEtC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,gCAAgC,CAAC,aAAa,CAAC,EAAE,CAAC;AACzF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollab,\n\tlowestMinVersionForCollab,\n} from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../../codec/index.js\";\nimport {\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype SchemaAndPolicy,\n\ttype TreeChunk,\n} from \"../../../core/index.js\";\nimport {\n\tbrand,\n\tbrandedNumberType,\n\ttype Brand,\n\ttype JsonCompatibleReadOnly,\n\tunbrand,\n} from \"../../../util/index.js\";\nimport { TreeCompressionStrategy } from \"../../treeCompressionUtils.js\";\n\nimport { decode } from \"./chunkDecoding.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport { EncodedFieldBatch, validVersions, FieldBatchFormatVersion } from \"./format.js\";\nimport type { IncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from \"./schemaBasedEncode.js\";\nimport { uncompressedEncodeV1, uncompressedEncodeV2 } from \"./uncompressedEncode.js\";\n\n/**\n * Reference ID for a chunk that is incrementally encoded.\n */\nexport type ChunkReferenceId = Brand<number, \"forest.ChunkReferenceId\">;\nconst ChunkReferenceId = brandedNumberType<ChunkReferenceId>({ multipleOf: 1, minimum: 0 });\n\n/**\n * Properties for incremental encoding.\n * Fields that support incremental encoding will encode their chunks separately by calling `encodeIncrementalField`.\n * @remarks\n * This supports features like incremental summarization where the summary from these fields can be re-used if\n * unchanged between summaries.\n * Note that each of these chunks that are incrementally encoded is fully self-describing (contain its own shapes\n * list and identifier table) and does not rely on context from its parent.\n */\nexport interface IncrementalEncoder {\n\t/**\n\t * Returns whether a node / field should be incrementally encoded.\n\t * @remarks See {@link IncrementalEncodingPolicy}.\n\t */\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy;\n\t/**\n\t * Called to encode an incremental field at the cursor.\n\t * The chunks for this field are encoded separately from the main buffer.\n\t * @param cursor - The cursor pointing to the field to encode.\n\t * @param chunkEncoder - A function that encodes the contents of the passed chunk in the field.\n\t * @returns The reference IDs of the encoded chunks in the field.\n\t * This is used to retrieve the encoded chunks later.\n\t */\n\tencodeIncrementalField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tchunkEncoder: (chunk: TreeChunk) => EncodedFieldBatch,\n\t): ChunkReferenceId[];\n}\n\n/**\n * Properties for incremental decoding.\n *\n * Fields that had their chunks incrementally encoded will retrieve them by calling `getEncodedIncrementalChunk`.\n * @remarks\n * See {@link IncrementalEncoder} for more details.\n */\nexport interface IncrementalDecoder {\n\t/**\n\t * Called to decode an incremental chunk with the given reference ID.\n\t * @param referenceId - The reference ID of the chunk to decode.\n\t * @param chunkDecoder - A function that decodes the chunk.\n\t * @returns The decoded chunk.\n\t */\n\tdecodeIncrementalChunk(\n\t\treferenceId: ChunkReferenceId,\n\t\tchunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk,\n\t): TreeChunk;\n}\n/**\n * Combines the properties of {@link IncrementalEncoder} and {@link IncrementalDecoder}.\n */\nexport interface IncrementalEncoderDecoder extends IncrementalEncoder, IncrementalDecoder {}\n\nexport interface FieldBatchEncodingContext {\n\treadonly encodeType: TreeCompressionStrategy;\n\treadonly idCompressor: IIdCompressor;\n\treadonly originatorId: SessionId;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * An encoder / decoder for encoding and decoding of incremental fields.\n\t * This will be defined if incremental encoding is supported and enabled.\n\t */\n\treadonly incrementalEncoderDecoder?: IncrementalEncoderDecoder;\n}\n/**\n * @remarks\n * Fields in this batch currently don't have field schema for the root, which limits optimizations.\n */\nexport type FieldBatchCodec = IJsonCodec<\n\tFieldBatch,\n\tEncodedFieldBatch,\n\tJsonCompatibleReadOnly,\n\tFieldBatchEncodingContext\n>;\n\n/**\n * Convert a MinimumVersionForCollab to write version for {@link FieldBatchCodec}.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n */\nfunction clientVersionToFieldBatchVersion(\n\tclientVersion: MinimumVersionForCollab,\n): FieldBatchFormatVersion {\n\treturn brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: FieldBatchFormatVersion.v1,\n\t\t\t[FluidClientVersion.v2_73]: FieldBatchFormatVersion.v2,\n\t\t}),\n\t);\n}\n\nexport function makeFieldBatchCodec(options: CodecWriteOptions): FieldBatchCodec {\n\tconst writeVersion = clientVersionToFieldBatchVersion(options.minVersionForCollab);\n\t// Note: it's important that the decode function is schema-agnostic for this strategy/layering to work, since\n\t// the schema that an op was encoded in doesn't necessarily match the current schema for the document (e.g. if\n\t// decode is being run on a client that just submitted a schema change, but the op is from another client who has\n\t// yet to receive that change).\n\tassert(\n\t\tvalidVersions.has(writeVersion),\n\t\t0x935 /* Invalid write version for FieldBatch codec */,\n\t);\n\n\tlet uncompressedEncodeFn: typeof uncompressedEncodeV1 | typeof uncompressedEncodeV2;\n\tlet schemaCompressedEncodeFn:\n\t\t| typeof schemaCompressedEncodeV1\n\t\t| typeof schemaCompressedEncodeV2;\n\tswitch (writeVersion) {\n\t\tcase unbrand(FieldBatchFormatVersion.v1): {\n\t\t\tuncompressedEncodeFn = uncompressedEncodeV1;\n\t\t\tschemaCompressedEncodeFn = schemaCompressedEncodeV1;\n\t\t\tbreak;\n\t\t}\n\t\tcase unbrand(FieldBatchFormatVersion.v2): {\n\t\t\tuncompressedEncodeFn = uncompressedEncodeV2;\n\t\t\tschemaCompressedEncodeFn = schemaCompressedEncodeV2;\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tunreachableCase(writeVersion);\n\t\t}\n\t}\n\n\t// Both the encode and decode logic here support both v1 and v2, as does `validVersions` and `EncodedFieldBatch`.\n\t// This makes this use of makeVersionedValidatedCodec atypical as it is a single call being used to make a codec that supports all versions,\n\t// instead of one call per version, then using another utility to select between them based on version.\n\treturn makeVersionedValidatedCodec(options, validVersions, EncodedFieldBatch, {\n\t\tencode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {\n\t\t\tfor (const cursor of data) {\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t\t\t0x8a3 /* FieldBatch expects fields cursors */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlet encoded: EncodedFieldBatch;\n\t\t\tlet incrementalEncoder: IncrementalEncoder | undefined;\n\t\t\tswitch (context.encodeType) {\n\t\t\t\tcase TreeCompressionStrategy.Uncompressed: {\n\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TreeCompressionStrategy.CompressedIncremental: {\n\t\t\t\t\tassert(\n\t\t\t\t\t\twriteVersion >= FieldBatchFormatVersion.v2,\n\t\t\t\t\t\t0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,\n\t\t\t\t\t);\n\t\t\t\t\t// Incremental encoding is only supported for CompressedIncremental.\n\t\t\t\t\tincrementalEncoder = context.incrementalEncoderDecoder;\n\t\t\t\t}\n\t\t\t\t// fallthrough\n\t\t\t\tcase TreeCompressionStrategy.Compressed: {\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\t\t\tif (context.schema === undefined) {\n\t\t\t\t\t\t// TODO: consider enabling a somewhat compressed but not schema accelerated encode.\n\t\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tencoded = schemaCompressedEncodeFn(\n\t\t\t\t\t\t\tcontext.schema.schema,\n\t\t\t\t\t\t\tcontext.schema.policy,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tcontext.idCompressor,\n\t\t\t\t\t\t\tincrementalEncoder,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(context.encodeType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: consider checking input data was in schema.\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: EncodedFieldBatch, context: FieldBatchEncodingContext): FieldBatch => {\n\t\t\t// TODO: consider checking data is in schema.\n\t\t\treturn decode(\n\t\t\t\tdata,\n\t\t\t\t{\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t},\n\t\t\t\tcontext.incrementalEncoderDecoder,\n\t\t\t).map((chunk) => chunk.cursor());\n\t\t},\n\t});\n}\n\nexport function getCodecTreeForFieldBatchFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn { name: \"FieldBatch\", version: clientVersionToFieldBatchVersion(clientVersion) };\n}\n"]}
1
+ {"version":3,"file":"codecs.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/codecs.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AAE9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAGnF,OAAO,EACN,oCAAoC,EAEpC,kBAAkB,GAClB,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,iBAAiB,EAAc,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,OAAO,EAEN,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAMrF,MAAM,gBAAgB,GAAG,iBAAiB,CAAmB,EAAE,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAwE5F;;GAEG;AACH,SAAS,6BAA6B,CACrC,OAAgC,EAChC,oBAA8D,EAC9D,wBAMsB,EACtB,qBAA8B;IAE9B,OAAO;QACN,MAAM,EAAE,CAAC,IAAgB,EAAE,OAAkC,EAAqB,EAAE;YACnF,KAAK,MAAM,MAAM,IAAI,IAAI,EAAE,CAAC;gBAC3B,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E,OAAO,CAAC,YAAY;gBAClC,YAAY,EAAE,OAAO,CAAC,YAAY;aAClC,EACD,OAAO,CAAC,yBAAyB,CACjC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;QAClC,CAAC;QACD,MAAM,EAAE,qBAAqB;KAC7B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,oCAAoC,CAAC,KAAK,CAC/E,YAAY,EACZ;IACC;QACC,mBAAmB,EAAE,yBAAyB;QAC9C,aAAa,EAAE,uBAAuB,CAAC,EAAE;QACzC,KAAK,EAAE,6BAA6B,CACnC,uBAAuB,CAAC,EAAE,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,CACnB;KACD;IACD;QACC,mBAAmB,EAAE,kBAAkB,CAAC,KAAK;QAC7C,aAAa,EAAE,uBAAuB,CAAC,EAAE;QACzC,KAAK,EAAE,6BAA6B,CACnC,uBAAuB,CAAC,EAAE,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,mBAAmB,CACnB;KACD;CACD,CACD,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, unreachableCase } from \"@fluidframework/core-utils/internal\";\nimport type { IIdCompressor, SessionId } from \"@fluidframework/id-compressor\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\nimport type { TSchema } from \"@sinclair/typebox\";\n\nimport {\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecAndSchema,\n\tFluidClientVersion,\n} from \"../../../codec/index.js\";\nimport {\n\tCursorLocationType,\n\ttype ITreeCursorSynchronous,\n\ttype SchemaAndPolicy,\n\ttype SchemaPolicy,\n\ttype StoredSchemaCollection,\n\ttype TreeChunk,\n} from \"../../../core/index.js\";\nimport { brandedNumberType, type Brand } from \"../../../util/index.js\";\nimport { TreeCompressionStrategy } from \"../../treeCompressionUtils.js\";\n\nimport { decode } from \"./chunkDecoding.js\";\nimport type { FieldBatch } from \"./fieldBatch.js\";\nimport {\n\ttype EncodedFieldBatch,\n\tFieldBatchFormatVersion,\n\tEncodedFieldBatchV1,\n\tEncodedFieldBatchV2,\n} from \"./format.js\";\nimport type { IncrementalEncodingPolicy } from \"./incrementalEncodingPolicy.js\";\nimport { schemaCompressedEncodeV1, schemaCompressedEncodeV2 } from \"./schemaBasedEncode.js\";\nimport { uncompressedEncodeV1, uncompressedEncodeV2 } from \"./uncompressedEncode.js\";\n\n/**\n * Reference ID for a chunk that is incrementally encoded.\n */\nexport type ChunkReferenceId = Brand<number, \"forest.ChunkReferenceId\">;\nconst ChunkReferenceId = brandedNumberType<ChunkReferenceId>({ multipleOf: 1, minimum: 0 });\n\n/**\n * Properties for incremental encoding.\n * Fields that support incremental encoding will encode their chunks separately by calling `encodeIncrementalField`.\n * @remarks\n * This supports features like incremental summarization where the summary from these fields can be re-used if\n * unchanged between summaries.\n * Note that each of these chunks that are incrementally encoded is fully self-describing (contain its own shapes\n * list and identifier table) and does not rely on context from its parent.\n */\nexport interface IncrementalEncoder {\n\t/**\n\t * Returns whether a node / field should be incrementally encoded.\n\t * @remarks See {@link IncrementalEncodingPolicy}.\n\t */\n\tshouldEncodeIncrementally: IncrementalEncodingPolicy;\n\t/**\n\t * Called to encode an incremental field at the cursor.\n\t * The chunks for this field are encoded separately from the main buffer.\n\t * @param cursor - The cursor pointing to the field to encode.\n\t * @param chunkEncoder - A function that encodes the contents of the passed chunk in the field.\n\t * @returns The reference IDs of the encoded chunks in the field.\n\t * This is used to retrieve the encoded chunks later.\n\t */\n\tencodeIncrementalField(\n\t\tcursor: ITreeCursorSynchronous,\n\t\tchunkEncoder: (chunk: TreeChunk) => EncodedFieldBatch,\n\t): ChunkReferenceId[];\n}\n\n/**\n * Properties for incremental decoding.\n *\n * Fields that had their chunks incrementally encoded will retrieve them by calling `getEncodedIncrementalChunk`.\n * @remarks\n * See {@link IncrementalEncoder} for more details.\n */\nexport interface IncrementalDecoder {\n\t/**\n\t * Called to decode an incremental chunk with the given reference ID.\n\t * @param referenceId - The reference ID of the chunk to decode.\n\t * @param chunkDecoder - A function that decodes the chunk.\n\t * @returns The decoded chunk.\n\t */\n\tdecodeIncrementalChunk(\n\t\treferenceId: ChunkReferenceId,\n\t\tchunkDecoder: (encoded: EncodedFieldBatch) => TreeChunk,\n\t): TreeChunk;\n}\n/**\n * Combines the properties of {@link IncrementalEncoder} and {@link IncrementalDecoder}.\n */\nexport interface IncrementalEncoderDecoder extends IncrementalEncoder, IncrementalDecoder {}\n\nexport interface FieldBatchEncodingContext {\n\treadonly encodeType: TreeCompressionStrategy;\n\treadonly idCompressor: IIdCompressor;\n\treadonly originatorId: SessionId;\n\treadonly schema?: SchemaAndPolicy;\n\t/**\n\t * An encoder / decoder for encoding and decoding of incremental fields.\n\t * This will be defined if incremental encoding is supported and enabled.\n\t */\n\treadonly incrementalEncoderDecoder?: IncrementalEncoderDecoder;\n}\n/**\n * @remarks\n * Fields in this batch currently don't have field schema for the root, which limits optimizations.\n */\nexport type FieldBatchCodec = ReturnType<typeof fieldBatchCodecBuilder.build>;\n\n/**\n * Creates the encode/decode functions for a specific FieldBatch format version.\n */\nfunction makeFieldBatchCodecForVersion(\n\tversion: FieldBatchFormatVersion,\n\tuncompressedEncodeFn: (batch: FieldBatch) => EncodedFieldBatch,\n\tschemaCompressedEncodeFn: (\n\t\tschema: StoredSchemaCollection,\n\t\tpolicy: SchemaPolicy,\n\t\tfieldBatch: FieldBatch,\n\t\tidCompressor: IIdCompressor,\n\t\tincrementalEncoder: IncrementalEncoder | undefined,\n\t) => EncodedFieldBatch,\n\tencodedFieldBatchType: TSchema,\n): CodecAndSchema<FieldBatch, FieldBatchEncodingContext> {\n\treturn {\n\t\tencode: (data: FieldBatch, context: FieldBatchEncodingContext): EncodedFieldBatch => {\n\t\t\tfor (const cursor of data) {\n\t\t\t\tassert(\n\t\t\t\t\tcursor.mode === CursorLocationType.Fields,\n\t\t\t\t\t0x8a3 /* FieldBatch expects fields cursors */,\n\t\t\t\t);\n\t\t\t}\n\t\t\tlet encoded: EncodedFieldBatch;\n\t\t\tlet incrementalEncoder: IncrementalEncoder | undefined;\n\t\t\tswitch (context.encodeType) {\n\t\t\t\tcase TreeCompressionStrategy.Uncompressed: {\n\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tcase TreeCompressionStrategy.CompressedIncremental: {\n\t\t\t\t\tassert(\n\t\t\t\t\t\tversion >= FieldBatchFormatVersion.v2,\n\t\t\t\t\t\t0xca0 /* Unsupported FieldBatchFormatVersion for incremental encoding; must be v2 or higher */,\n\t\t\t\t\t);\n\t\t\t\t\t// Incremental encoding is only supported for CompressedIncremental.\n\t\t\t\t\tincrementalEncoder = context.incrementalEncoderDecoder;\n\t\t\t\t}\n\t\t\t\t// fallthrough\n\t\t\t\tcase TreeCompressionStrategy.Compressed: {\n\t\t\t\t\t// eslint-disable-next-line unicorn/prefer-ternary\n\t\t\t\t\tif (context.schema === undefined) {\n\t\t\t\t\t\t// TODO: consider enabling a somewhat compressed but not schema accelerated encode.\n\t\t\t\t\t\tencoded = uncompressedEncodeFn(data);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tencoded = schemaCompressedEncodeFn(\n\t\t\t\t\t\t\tcontext.schema.schema,\n\t\t\t\t\t\t\tcontext.schema.policy,\n\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\tcontext.idCompressor,\n\t\t\t\t\t\t\tincrementalEncoder,\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tdefault: {\n\t\t\t\t\tunreachableCase(context.encodeType);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// TODO: consider checking input data was in schema.\n\t\t\treturn encoded;\n\t\t},\n\t\tdecode: (data: EncodedFieldBatch, context: FieldBatchEncodingContext): FieldBatch => {\n\t\t\t// TODO: consider checking data is in schema.\n\t\t\treturn decode(\n\t\t\t\tdata,\n\t\t\t\t{\n\t\t\t\t\tidCompressor: context.idCompressor,\n\t\t\t\t\toriginatorId: context.originatorId,\n\t\t\t\t},\n\t\t\t\tcontext.incrementalEncoderDecoder,\n\t\t\t).map((chunk) => chunk.cursor());\n\t\t},\n\t\tschema: encodedFieldBatchType,\n\t};\n}\n\n/**\n * {@link ClientVersionDispatchingCodecBuilder} for field batch codecs.\n */\nexport const fieldBatchCodecBuilder = ClientVersionDispatchingCodecBuilder.build(\n\t\"FieldBatch\",\n\t[\n\t\t{\n\t\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\t\tformatVersion: FieldBatchFormatVersion.v1,\n\t\t\tcodec: makeFieldBatchCodecForVersion(\n\t\t\t\tFieldBatchFormatVersion.v1,\n\t\t\t\tuncompressedEncodeV1,\n\t\t\t\tschemaCompressedEncodeV1,\n\t\t\t\tEncodedFieldBatchV1,\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tminVersionForCollab: FluidClientVersion.v2_73,\n\t\t\tformatVersion: FieldBatchFormatVersion.v2,\n\t\t\tcodec: makeFieldBatchCodecForVersion(\n\t\t\t\tFieldBatchFormatVersion.v2,\n\t\t\t\tuncompressedEncodeV2,\n\t\t\t\tschemaCompressedEncodeV2,\n\t\t\t\tEncodedFieldBatchV2,\n\t\t\t),\n\t\t},\n\t],\n);\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,KAAK,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAGtD,OAAO,EAAc,KAAK,MAAM,EAAE,MAAM,wBAAwB,CAAC;AASjE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;CAGlC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,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WAEG;;YA3CH;;eAEG;;;YAGH;;;;eAIG;;YAEH;;;eAGG;;;QA+BH;;WAEG;;QAEH;;WAEG;;;;;;;;QAlBH;;WAEG;;QAEH;;WAEG;;;YArJH;;eAEG;;;QAqJH;;WAEG;;YA3CH;;eAEG;;;YAGH;;;;eAIG;;YAEH;;;eAGG;;;QA+BH;;WAEG;;QAEH;;WAEG;;;IA0BkF,CAAC;AACxF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -10,7 +10,18 @@ import { Count, EncodedFieldBatchGeneric, IdentifierOrIndex, ShapeIndex, } from
10
10
  * The format version for the field batch.
11
11
  */
12
12
  export const FieldBatchFormatVersion = strictEnum("FieldBatchFormatVersion", {
13
+ /**
14
+ * Initial version.
15
+ * @remarks
16
+ * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}
17
+ * as older clients will not know how to handle that shape but think they can handle this format.
18
+ */
13
19
  v1: 1,
20
+ /**
21
+ * Adds support for incremental encoding of chunks.
22
+ * @remarks
23
+ * {@link EncodedIncrementalChunkShape} was added in this version.
24
+ */
14
25
  v2: 2,
15
26
  });
16
27
  // Compatible versions used for format/version validation.
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/format.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAe,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAe,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EACN,KAAK,EACL,wBAAwB,EACxB,iBAAiB,EACjB,UAAU,GACV,MAAM,oBAAoB,CAAC;AAE5B;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,UAAU,CAAC,yBAAyB,EAAE;IAC5E,EAAE,EAAE,CAAC;IACL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,CAAC,uBAAuB,CAAC;IACzC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAClC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAC9C,EACD,YAAY,CACZ,CAAC;AAUF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAC1D,uBAAuB,CAAC,EAAE,EAC1B,iBAAiB,CACjB,CAAC;AAGF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAC1D,uBAAuB,CAAC,EAAE,EAC1B,iBAAiB,CACjB,CAAC;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../codec/index.js\";\nimport { strictEnum, type Values } from \"../../../util/index.js\";\n\nimport {\n\tCount,\n\tEncodedFieldBatchGeneric,\n\tIdentifierOrIndex,\n\tShapeIndex,\n} from \"./formatGeneric.js\";\n\n/**\n * The format version for the field batch.\n */\nexport const FieldBatchFormatVersion = strictEnum(\"FieldBatchFormatVersion\", {\n\tv1: 1,\n\tv2: 2,\n});\nexport type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;\n\n// Compatible versions used for format/version validation.\n// TODO: A proper version update policy will need to be documented.\nexport const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);\n\n/**\n * Top level length is implied from length of data array.\n * All content are of this shape.\n */\nexport const EncodedNestedArrayShape = ShapeIndex;\n\n/**\n * Inline array.\n */\nexport const EncodedInlineArrayShape = Type.Object(\n\t{\n\t\tlength: Count,\n\t\t/**\n\t\t * All entries are this shape.\n\t\t */\n\t\tshape: ShapeIndex,\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Encoded as `shape, ...[data for shape]`.\n *\n * Used for polymorphism.\n */\nexport const EncodedAnyShape = Type.Literal(0);\n\n/**\n * Encoded content is a {@link ChunkReferenceId}.\n * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.\n */\nexport const EncodedIncrementalChunkShape = Type.Literal(0);\n\n/**\n * Content of the encoded field is specified by the Shape referenced by the ShapeIndex.\n * This is a tuple for conciseness.\n */\nexport const EncodedFieldShape = Type.Tuple([\n\t/**\n\t * Field key for this field.\n\t */\n\tIdentifierOrIndex,\n\t/**\n\t * Shape of data in this field.\n\t */\n\tShapeIndex,\n]);\n\nexport type EncodedFieldShape = Static<typeof EncodedFieldShape>;\n\nenum CounterRelativeTo {\n\t// Relative to previous node of same type in depth first pre-order traversal.\n\tPreviousNodeOfType_DepthFirstPreOrder,\n\t// TODO: add alternative relative mode relative to previous note at a path to allow delta encoded sequences (like points where x and y are delta encoded relative to previous points).\n}\n\nenum CounterMode {\n\tNumber,\n\t// TODO: document wrap modes and bit skipping. Note UUID subVersion here (ex: UUIDv4)\n\tUUID,\n}\n\n/**\n * Delta encoded value relative to a previous node's value.\n */\nexport const EncodedCounter = Type.Object(\n\t{\n\t\trelativeTo: Type.Enum(CounterRelativeTo),\n\t\t// If not provided, delta inline in data.\n\t\tdelta: Type.Optional(Type.Number()),\n\t\tmode: Type.Enum(CounterMode),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Used in {@link EncodedValueShape} for special field kind handling.\n */\nexport enum SpecialField {\n\t/**\n\t * Special case for Identifier field kind.\n\t */\n\tIdentifier = 0,\n}\n\n/**\n * Shape of a value on a node.\n *\n * Due to limitations of TypeBox and differences between JavaScript objects, TypeScript types and JSON,\n * the case where no information about the value is captured in the shape is a bit confusing.\n * In TypeBox this is allowed by the user of this type putting it in an optional property.\n * In TypeScript it is modeled using `undefined`.\n * In JavaScript the property may be missing or explicitly `undefined`.\n * In JSON this will serialize as the property being omitted.\n * In this case, the value will be encoded as either:\n * - `false` (when there is no value) OR\n * - `true, value` when there is a value.\n *\n * For a more compact encoding, there are 4 options for the shape:\n * - `true`: there is a value, and it will simply be encoded by putting it in the output buffer (so `value`).\n * - `false`: there is never a value, and it takes up no space in the output buffer.\n * - `[value]`: there is a value, and its always the same.\n * - `SpecialField.Identifier`: special case for node identifier handling.\n * Takes up no space in the output buffer: the value comes from the shape arrays's content.\n * It is wrapped in an array to differentiate value shape types.\n *\n * In the future other value shape formats may be added, likely as objects.\n *\n * @remarks\n * See {@link EncodedNodeShape} for usage.\n */\nexport const EncodedValueShape = Type.Union([\n\tType.Boolean(),\n\tType.Array(Type.Any(), { minItems: 1, maxItems: 1 }),\n\tType.Enum(SpecialField),\n\t// TODO: support delta encoding and/or special node identifier handling\n\t// EncodedCounter,\n]);\nexport type EncodedValueShape = undefined | Static<typeof EncodedValueShape>;\n\nexport const EncodedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * If not provided, inlined in data.\n\t\t */\n\t\ttype: Type.Optional(IdentifierOrIndex),\n\t\tvalue: Type.Optional(EncodedValueShape),\n\t\t/**\n\t\t * Fields with fixed (per key) shapes.\n\t\t * They are encoded in the order they are specified here.\n\t\t * To ensure the order is preserved, this is an array instead of an object with keys.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If undefined, no data. Otherwise, nested array of `[key, ...data]*`\n\t\t * Covers any fields beyond those in `fields`.\n\t\t */\n\t\textraFields: Type.Optional(ShapeIndex),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Discriminated union that represents the shapes of chunks in the encoded data.\n * \"Chunk\" here refers to a chunk of tree data, rooted at a range of nodes, that is encoded as a\n * single unit in a specific format represented by one of the shapes in this union.\n *\n * The concept of \"chunk\" is same for the tree data in memory and in the encoded wire format.\n * The physical representation of the chunk may differ, but the logical structure remains the same.\n * This is similar to other such concepts in the system.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const EncodedChunkShape = Type.Object(\n\t{\n\t\t/**\n\t\t * {@link EncodedNestedArrayShape} union member.\n\t\t */\n\t\ta: Type.Optional(EncodedNestedArrayShape),\n\t\t/**\n\t\t * {@link EncodedInlineArrayShape} union member.\n\t\t */\n\t\tb: Type.Optional(EncodedInlineArrayShape),\n\t\t/**\n\t\t * {@link EncodedNodeShape} union member.\n\t\t */\n\t\tc: Type.Optional(EncodedNodeShape),\n\t\t/**\n\t\t * {@link EncodedAnyShape} union member.\n\t\t */\n\t\td: Type.Optional(EncodedAnyShape),\n\t\t/**\n\t\t * {@link EncodedIncrementalChunkShape} union member.\n\t\t */\n\t\te: Type.Optional(EncodedIncrementalChunkShape),\n\t},\n\tunionOptions,\n);\n\nexport type EncodedChunkShape = Static<typeof EncodedChunkShape>;\n\nexport type EncodedNestedArrayShape = Static<typeof EncodedNestedArrayShape>;\nexport type EncodedInlineArrayShape = Static<typeof EncodedInlineArrayShape>;\nexport type EncodedNodeShape = Static<typeof EncodedNodeShape>;\nexport type EncodedAnyShape = Static<typeof EncodedAnyShape>;\nexport type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;\n\nexport const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v1,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;\n\nexport const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v2,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;\n\nexport const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);\nexport type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;\n"]}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/format.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ACH,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACpD;;;OAGG;IACH,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;CACtC,EACD,EAAE,oBAAoB,EAAE,KAAK,EAAE,CAC/B,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,MAAM,CAC3C;IACC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACzC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,uBAAuB,CAAC;IACzC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IAClC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;IACjC;;OAEG;IACH,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,4BAA4B,CAAC;CAC9C,EACD,YAAY,CACZ,CAAC;AAUF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAC1D,uBAAuB,CAAC,EAAE,EAC1B,iBAAiB,CACjB,CAAC;AAGF,MAAM,CAAC,MAAM,mBAAmB,GAAG,wBAAwB,CAC1D,uBAAuB,CAAC,EAAE,EAC1B,iBAAiB,CACjB,CAAC;AAGF,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { type Static, Type } from \"@sinclair/typebox\";\n\nimport { unionOptions } from \"../../../codec/index.js\";\nimport { strictEnum, type Values } from \"../../../util/index.js\";\n\nimport {\n\tCount,\n\tEncodedFieldBatchGeneric,\n\tIdentifierOrIndex,\n\tShapeIndex,\n} from \"./formatGeneric.js\";\n\n/**\n * The format version for the field batch.\n */\nexport const FieldBatchFormatVersion = strictEnum(\"FieldBatchFormatVersion\", {\n\t/**\n\t * Initial version.\n\t * @remarks\n\t * For simplicity of implementation the format for this version allows the same chunk shapes as v2, but must not use {@link EncodedIncrementalChunkShape}\n\t * as older clients will not know how to handle that shape but think they can handle this format.\n\t */\n\tv1: 1,\n\t/**\n\t * Adds support for incremental encoding of chunks.\n\t * @remarks\n\t * {@link EncodedIncrementalChunkShape} was added in this version.\n\t */\n\tv2: 2,\n});\nexport type FieldBatchFormatVersion = Values<typeof FieldBatchFormatVersion>;\n\n// Compatible versions used for format/version validation.\n// TODO: A proper version update policy will need to be documented.\nexport const validVersions = new Set([...Object.values(FieldBatchFormatVersion)]);\n\n/**\n * Top level length is implied from length of data array.\n * All content are of this shape.\n */\nexport const EncodedNestedArrayShape = ShapeIndex;\n\n/**\n * Inline array.\n */\nexport const EncodedInlineArrayShape = Type.Object(\n\t{\n\t\tlength: Count,\n\t\t/**\n\t\t * All entries are this shape.\n\t\t */\n\t\tshape: ShapeIndex,\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Encoded as `shape, ...[data for shape]`.\n *\n * Used for polymorphism.\n */\nexport const EncodedAnyShape = Type.Literal(0);\n\n/**\n * Encoded content is a {@link ChunkReferenceId}.\n * This represents the shape of a chunk that is encoded separately and is referenced by its {@link ChunkReferenceId}.\n */\nexport const EncodedIncrementalChunkShape = Type.Literal(0);\n\n/**\n * Content of the encoded field is specified by the Shape referenced by the ShapeIndex.\n * This is a tuple for conciseness.\n */\nexport const EncodedFieldShape = Type.Tuple([\n\t/**\n\t * Field key for this field.\n\t */\n\tIdentifierOrIndex,\n\t/**\n\t * Shape of data in this field.\n\t */\n\tShapeIndex,\n]);\n\nexport type EncodedFieldShape = Static<typeof EncodedFieldShape>;\n\nenum CounterRelativeTo {\n\t// Relative to previous node of same type in depth first pre-order traversal.\n\tPreviousNodeOfType_DepthFirstPreOrder,\n\t// TODO: add alternative relative mode relative to previous note at a path to allow delta encoded sequences (like points where x and y are delta encoded relative to previous points).\n}\n\nenum CounterMode {\n\tNumber,\n\t// TODO: document wrap modes and bit skipping. Note UUID subVersion here (ex: UUIDv4)\n\tUUID,\n}\n\n/**\n * Delta encoded value relative to a previous node's value.\n */\nexport const EncodedCounter = Type.Object(\n\t{\n\t\trelativeTo: Type.Enum(CounterRelativeTo),\n\t\t// If not provided, delta inline in data.\n\t\tdelta: Type.Optional(Type.Number()),\n\t\tmode: Type.Enum(CounterMode),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Used in {@link EncodedValueShape} for special field kind handling.\n */\nexport enum SpecialField {\n\t/**\n\t * Special case for Identifier field kind.\n\t */\n\tIdentifier = 0,\n}\n\n/**\n * Shape of a value on a node.\n *\n * Due to limitations of TypeBox and differences between JavaScript objects, TypeScript types and JSON,\n * the case where no information about the value is captured in the shape is a bit confusing.\n * In TypeBox this is allowed by the user of this type putting it in an optional property.\n * In TypeScript it is modeled using `undefined`.\n * In JavaScript the property may be missing or explicitly `undefined`.\n * In JSON this will serialize as the property being omitted.\n * In this case, the value will be encoded as either:\n * - `false` (when there is no value) OR\n * - `true, value` when there is a value.\n *\n * For a more compact encoding, there are 4 options for the shape:\n * - `true`: there is a value, and it will simply be encoded by putting it in the output buffer (so `value`).\n * - `false`: there is never a value, and it takes up no space in the output buffer.\n * - `[value]`: there is a value, and its always the same.\n * - `SpecialField.Identifier`: special case for node identifier handling.\n * Takes up no space in the output buffer: the value comes from the shape arrays's content.\n * It is wrapped in an array to differentiate value shape types.\n *\n * In the future other value shape formats may be added, likely as objects.\n *\n * @remarks\n * See {@link EncodedNodeShape} for usage.\n */\nexport const EncodedValueShape = Type.Union([\n\tType.Boolean(),\n\tType.Array(Type.Any(), { minItems: 1, maxItems: 1 }),\n\tType.Enum(SpecialField),\n\t// TODO: support delta encoding and/or special node identifier handling\n\t// EncodedCounter,\n]);\nexport type EncodedValueShape = undefined | Static<typeof EncodedValueShape>;\n\nexport const EncodedNodeShape = Type.Object(\n\t{\n\t\t/**\n\t\t * If not provided, inlined in data.\n\t\t */\n\t\ttype: Type.Optional(IdentifierOrIndex),\n\t\tvalue: Type.Optional(EncodedValueShape),\n\t\t/**\n\t\t * Fields with fixed (per key) shapes.\n\t\t * They are encoded in the order they are specified here.\n\t\t * To ensure the order is preserved, this is an array instead of an object with keys.\n\t\t */\n\t\tfields: Type.Optional(Type.Array(EncodedFieldShape)),\n\t\t/**\n\t\t * If undefined, no data. Otherwise, nested array of `[key, ...data]*`\n\t\t * Covers any fields beyond those in `fields`.\n\t\t */\n\t\textraFields: Type.Optional(ShapeIndex),\n\t},\n\t{ additionalProperties: false },\n);\n\n/**\n * Discriminated union that represents the shapes of chunks in the encoded data.\n * \"Chunk\" here refers to a chunk of tree data, rooted at a range of nodes, that is encoded as a\n * single unit in a specific format represented by one of the shapes in this union.\n *\n * The concept of \"chunk\" is same for the tree data in memory and in the encoded wire format.\n * The physical representation of the chunk may differ, but the logical structure remains the same.\n * This is similar to other such concepts in the system.\n *\n * See {@link DiscriminatedUnionDispatcher} for more information on this pattern.\n */\nexport const EncodedChunkShape = Type.Object(\n\t{\n\t\t/**\n\t\t * {@link EncodedNestedArrayShape} union member.\n\t\t */\n\t\ta: Type.Optional(EncodedNestedArrayShape),\n\t\t/**\n\t\t * {@link EncodedInlineArrayShape} union member.\n\t\t */\n\t\tb: Type.Optional(EncodedInlineArrayShape),\n\t\t/**\n\t\t * {@link EncodedNodeShape} union member.\n\t\t */\n\t\tc: Type.Optional(EncodedNodeShape),\n\t\t/**\n\t\t * {@link EncodedAnyShape} union member.\n\t\t */\n\t\td: Type.Optional(EncodedAnyShape),\n\t\t/**\n\t\t * {@link EncodedIncrementalChunkShape} union member.\n\t\t */\n\t\te: Type.Optional(EncodedIncrementalChunkShape),\n\t},\n\tunionOptions,\n);\n\nexport type EncodedChunkShape = Static<typeof EncodedChunkShape>;\n\nexport type EncodedNestedArrayShape = Static<typeof EncodedNestedArrayShape>;\nexport type EncodedInlineArrayShape = Static<typeof EncodedInlineArrayShape>;\nexport type EncodedNodeShape = Static<typeof EncodedNodeShape>;\nexport type EncodedAnyShape = Static<typeof EncodedAnyShape>;\nexport type EncodedIncrementalChunkShape = Static<typeof EncodedIncrementalChunkShape>;\n\nexport const EncodedFieldBatchV1 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v1,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV1 = Static<typeof EncodedFieldBatchV1>;\n\nexport const EncodedFieldBatchV2 = EncodedFieldBatchGeneric(\n\tFieldBatchFormatVersion.v2,\n\tEncodedChunkShape,\n);\nexport type EncodedFieldBatchV2 = Static<typeof EncodedFieldBatchV2>;\n\nexport const EncodedFieldBatch = Type.Union([EncodedFieldBatchV1, EncodedFieldBatchV2]);\nexport type EncodedFieldBatch = Static<typeof EncodedFieldBatch>;\n"]}
@@ -2,8 +2,9 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EncodedFieldBatch, FieldBatchFormatVersion } from "./format.js";
5
+ export type { EncodedFieldBatch } from "./format.js";
6
+ export { FieldBatchFormatVersion } from "./format.js";
6
7
  export type { FieldBatch } from "./fieldBatch.js";
7
- export { type FieldBatchCodec, makeFieldBatchCodec, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type IncrementalEncoder, type IncrementalDecoder, type ChunkReferenceId, getCodecTreeForFieldBatchFormat, } from "./codecs.js";
8
+ export { type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type IncrementalEncoder, type IncrementalDecoder, type ChunkReferenceId, } from "./codecs.js";
8
9
  export { type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./incrementalEncodingPolicy.js";
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACzE,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,+BAA+B,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACrB,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,gCAAgC,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- export { EncodedFieldBatch, FieldBatchFormatVersion } from "./format.js";
6
- export { makeFieldBatchCodec, getCodecTreeForFieldBatchFormat, } from "./codecs.js";
5
+ export { FieldBatchFormatVersion } from "./format.js";
6
+ export { fieldBatchCodecBuilder, } from "./codecs.js";
7
7
  export { defaultIncrementalEncodingPolicy, } from "./incrementalEncodingPolicy.js";
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAEN,mBAAmB,EAMnB,+BAA+B,GAC/B,MAAM,aAAa,CAAC;AACrB,OAAO,EAEN,gCAAgC,GAChC,MAAM,gCAAgC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { EncodedFieldBatch, FieldBatchFormatVersion } from \"./format.js\";\nexport type { FieldBatch } from \"./fieldBatch.js\";\nexport {\n\ttype FieldBatchCodec,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype IncrementalEncoder,\n\ttype IncrementalDecoder,\n\ttype ChunkReferenceId,\n\tgetCodecTreeForFieldBatchFormat,\n} from \"./codecs.js\";\nexport {\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./incrementalEncodingPolicy.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/feature-libraries/chunked-forest/codec/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAEN,sBAAsB,GAMtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAEN,gCAAgC,GAChC,MAAM,gCAAgC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport type { EncodedFieldBatch } from \"./format.js\";\nexport { FieldBatchFormatVersion } from \"./format.js\";\nexport type { FieldBatch } from \"./fieldBatch.js\";\nexport {\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype IncrementalEncoder,\n\ttype IncrementalDecoder,\n\ttype ChunkReferenceId,\n} from \"./codecs.js\";\nexport {\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./incrementalEncodingPolicy.js\";\n"]}
@@ -6,6 +6,6 @@ export { uniformChunk, ChunkShape } from "./uniformChunk.js";
6
6
  export { type TreeChunk, dummyRoot } from "../../core/index.js";
7
7
  export { chunkTree, defaultChunkPolicy, makeTreeChunker, type IChunker, chunkFieldSingle, chunkField, combineChunks, } from "./chunkTree.js";
8
8
  export { buildChunkedForest } from "./chunkedForest.js";
9
- export { EncodedFieldBatch, FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, type FieldBatch, type FieldBatchCodec, makeFieldBatchCodec, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
9
+ export { type EncodedFieldBatch, FieldBatchFormatVersion, type FieldBatch, type FieldBatchCodec, fieldBatchCodecBuilder, type FieldBatchEncodingContext, type IncrementalEncoderDecoder, type ChunkReferenceId, type IncrementalEncodingPolicy, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
10
10
  export { emptyChunk } from "./emptyChunk.js";
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,iBAAiB,EACjB,uBAAuB,EACvB,+BAA+B,EAC/B,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,mBAAmB,EACnB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,KAAK,SAAS,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,KAAK,QAAQ,EACb,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC"}
@@ -6,6 +6,6 @@ export { uniformChunk, ChunkShape } from "./uniformChunk.js";
6
6
  export { dummyRoot } from "../../core/index.js";
7
7
  export { chunkTree, defaultChunkPolicy, makeTreeChunker, chunkFieldSingle, chunkField, combineChunks, } from "./chunkTree.js";
8
8
  export { buildChunkedForest } from "./chunkedForest.js";
9
- export { EncodedFieldBatch, FieldBatchFormatVersion, getCodecTreeForFieldBatchFormat, makeFieldBatchCodec, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
9
+ export { FieldBatchFormatVersion, fieldBatchCodecBuilder, defaultIncrementalEncodingPolicy, } from "./codec/index.js";
10
10
  export { emptyChunk } from "./emptyChunk.js";
11
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EAEf,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EACN,iBAAiB,EACjB,uBAAuB,EACvB,+BAA+B,EAG/B,mBAAmB,EAKnB,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\tEncodedFieldBatch,\n\tFieldBatchFormatVersion,\n\tgetCodecTreeForFieldBatchFormat,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tmakeFieldBatchCodec,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/feature-libraries/chunked-forest/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAkB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EACN,SAAS,EACT,kBAAkB,EAClB,eAAe,EAEf,gBAAgB,EAChB,UAAU,EACV,aAAa,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAEN,uBAAuB,EAGvB,sBAAsB,EAKtB,gCAAgC,GAChC,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { uniformChunk, ChunkShape } from \"./uniformChunk.js\";\nexport { type TreeChunk, dummyRoot } from \"../../core/index.js\";\nexport {\n\tchunkTree,\n\tdefaultChunkPolicy,\n\tmakeTreeChunker,\n\ttype IChunker,\n\tchunkFieldSingle,\n\tchunkField,\n\tcombineChunks,\n} from \"./chunkTree.js\";\nexport { buildChunkedForest } from \"./chunkedForest.js\";\nexport {\n\ttype EncodedFieldBatch,\n\tFieldBatchFormatVersion,\n\ttype FieldBatch,\n\ttype FieldBatchCodec,\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n\ttype IncrementalEncoderDecoder,\n\ttype ChunkReferenceId,\n\ttype IncrementalEncodingPolicy,\n\tdefaultIncrementalEncodingPolicy,\n} from \"./codec/index.js\";\nexport { emptyChunk } from \"./emptyChunk.js\";\n"]}
@@ -10,8 +10,25 @@ import type { FlexTreeNode } from "./flexTreeTypes.js";
10
10
  * See {@link withObservation} and {@link currentObserver}.
11
11
  */
12
12
  export interface Observer {
13
+ /**
14
+ * Arbitrary content in `node` subtree might be observed.
15
+ */
16
+ observeNodeDeep(node: FlexTreeNode): void;
17
+ /**
18
+ * Which fields exist (as non-empty) on `node` is being observed.
19
+ * @remarks
20
+ * The set of fields should be considered order independent.
21
+ */
13
22
  observeNodeFields(node: FlexTreeNode): void;
23
+ /**
24
+ * The contents of the `key` field of `node` are being observed.
25
+ * @remarks
26
+ * Any (shallow) change to which children exist in this field, or in what order should invalidate this observation.
27
+ */
14
28
  observeNodeField(node: FlexTreeNode, key: FieldKey): void;
29
+ /**
30
+ * The parent of `node` is being observed.
31
+ */
15
32
  observeParentOf(node: FlexTreeNode): void;
16
33
  }
17
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/observer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASvD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACxB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5C,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1D,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,eAAO,IAAI,eAAe,EAAE,QAAQ,GAAG,SAAS,CAAC;AAgBjD;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAOnF"}
1
+ {"version":3,"file":"observer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/observer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASvD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACxB;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC1C;;;;OAIG;IACH,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5C;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC1D;;OAEG;IACH,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC;CAC1C;AAED;;;;;;;;;GASG;AACH,eAAO,IAAI,eAAe,EAAE,QAAQ,GAAG,SAAS,CAAC;AAgBjD;;GAEG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,WAAW,EAAE,QAAQ,GAAG,SAAS,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAOnF"}
@@ -1 +1 @@
1
- {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/observer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAwBlE;;;;;;;;;GASG;AACH,MAAM,CAAC,IAAI,eAAqC,CAAC;AAEjD,MAAM,aAAa,GAA6B,EAAE,CAAC;AAEnD,SAAS,WAAW,CAAC,WAAiC;IACrD,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,eAAe,GAAG,WAAW,CAAC;AAC/B,CAAC;AAED,SAAS,aAAa;IACrB,WAAW,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,+BAA+B,CAAC,CAAC;IAC/E,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC;IACnC,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,KAAK,eAAe,IAAI,2BAA2B,CAAC,CAAC;IAC7E,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAI,WAAiC,EAAE,CAAU;IAC/E,WAAW,CAAC,WAAW,CAAC,CAAC;IACzB,IAAI,CAAC;QACJ,OAAO,CAAC,EAAE,CAAC;IACZ,CAAC;YAAS,CAAC;QACV,aAAa,EAAE,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey } from \"../../core/index.js\";\n\nimport type { FlexTreeNode } from \"./flexTreeTypes.js\";\n\n/*\n * This file sets up a static observation tracking system.\n *\n * This library used to contain a more general variant of this which was deleted in https://github.com/microsoft/FluidFramework/pull/18659.\n * This pattern somewhat resembles the approach in https://github.com/tc39/proposal-signals.\n */\n\n/**\n * An object informed about observation made to trees.\n * @remarks\n * See {@link withObservation} and {@link currentObserver}.\n */\nexport interface Observer {\n\tobserveNodeFields(node: FlexTreeNode): void;\n\tobserveNodeField(node: FlexTreeNode, key: FieldKey): void;\n\tobserveParentOf(node: FlexTreeNode): void;\n}\n\n/**\n * The current observer, if any.\n * @remarks\n * Set via {@link setObserver} as used by {@link withObservation}.\n * It should not be assigned in any other way.\n * @privateRemarks\n * This is exported directly as a property instead of via a getter for reduced overhead (less code, faster access) as this is used on some hot paths and its performance matters.\n * The case where this is undefined (no observation) is particularly important for performance as we do not want to regress code which is not using this feature very much.\n * Since it is not exported outside the package, this seems like a fine tradeoff, but could be reevaluated with some benchmarking if needed.\n */\nexport let currentObserver: Observer | undefined;\n\nconst observerStack: (Observer | undefined)[] = [];\n\nfunction setObserver(newObserver: Observer | undefined): void {\n\tobserverStack.push(newObserver);\n\tcurrentObserver = newObserver;\n}\n\nfunction clearObserver(): void {\n\tdebugAssert(() => observerStack.length > 0 || \"Empty Observer stack on clear\");\n\tconst popped = observerStack.pop();\n\tdebugAssert(() => popped === currentObserver || \"Mismatched observer stack\");\n\tcurrentObserver = observerStack[observerStack.length - 1];\n}\n\n/**\n * For the duration of `f`, pushes `newObserver` onto the observer stack, making it the {@link currentObserver}.\n */\nexport function withObservation<T>(newObserver: Observer | undefined, f: () => T): T {\n\tsetObserver(newObserver);\n\ttry {\n\t\treturn f();\n\t} finally {\n\t\tclearObserver();\n\t}\n}\n"]}
1
+ {"version":3,"file":"observer.js","sourceRoot":"","sources":["../../../src/feature-libraries/flex-tree/observer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAyClE;;;;;;;;;GASG;AACH,MAAM,CAAC,IAAI,eAAqC,CAAC;AAEjD,MAAM,aAAa,GAA6B,EAAE,CAAC;AAEnD,SAAS,WAAW,CAAC,WAAiC;IACrD,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAChC,eAAe,GAAG,WAAW,CAAC;AAC/B,CAAC;AAED,SAAS,aAAa;IACrB,WAAW,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,IAAI,+BAA+B,CAAC,CAAC;IAC/E,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,EAAE,CAAC;IACnC,WAAW,CAAC,GAAG,EAAE,CAAC,MAAM,KAAK,eAAe,IAAI,2BAA2B,CAAC,CAAC;IAC7E,eAAe,GAAG,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAI,WAAiC,EAAE,CAAU;IAC/E,WAAW,CAAC,WAAW,CAAC,CAAC;IACzB,IAAI,CAAC;QACJ,OAAO,CAAC,EAAE,CAAC;IACZ,CAAC;YAAS,CAAC;QACV,aAAa,EAAE,CAAC;IACjB,CAAC;AACF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { debugAssert } from \"@fluidframework/core-utils/internal\";\n\nimport type { FieldKey } from \"../../core/index.js\";\n\nimport type { FlexTreeNode } from \"./flexTreeTypes.js\";\n\n/*\n * This file sets up a static observation tracking system.\n *\n * This library used to contain a more general variant of this which was deleted in https://github.com/microsoft/FluidFramework/pull/18659.\n * This pattern somewhat resembles the approach in https://github.com/tc39/proposal-signals.\n */\n\n/**\n * An object informed about observation made to trees.\n * @remarks\n * See {@link withObservation} and {@link currentObserver}.\n */\nexport interface Observer {\n\t/**\n\t * Arbitrary content in `node` subtree might be observed.\n\t */\n\tobserveNodeDeep(node: FlexTreeNode): void;\n\t/**\n\t * Which fields exist (as non-empty) on `node` is being observed.\n\t * @remarks\n\t * The set of fields should be considered order independent.\n\t */\n\tobserveNodeFields(node: FlexTreeNode): void;\n\t/**\n\t * The contents of the `key` field of `node` are being observed.\n\t * @remarks\n\t * Any (shallow) change to which children exist in this field, or in what order should invalidate this observation.\n\t */\n\tobserveNodeField(node: FlexTreeNode, key: FieldKey): void;\n\t/**\n\t * The parent of `node` is being observed.\n\t */\n\tobserveParentOf(node: FlexTreeNode): void;\n}\n\n/**\n * The current observer, if any.\n * @remarks\n * Set via {@link setObserver} as used by {@link withObservation}.\n * It should not be assigned in any other way.\n * @privateRemarks\n * This is exported directly as a property instead of via a getter for reduced overhead (less code, faster access) as this is used on some hot paths and its performance matters.\n * The case where this is undefined (no observation) is particularly important for performance as we do not want to regress code which is not using this feature very much.\n * Since it is not exported outside the package, this seems like a fine tradeoff, but could be reevaluated with some benchmarking if needed.\n */\nexport let currentObserver: Observer | undefined;\n\nconst observerStack: (Observer | undefined)[] = [];\n\nfunction setObserver(newObserver: Observer | undefined): void {\n\tobserverStack.push(newObserver);\n\tcurrentObserver = newObserver;\n}\n\nfunction clearObserver(): void {\n\tdebugAssert(() => observerStack.length > 0 || \"Empty Observer stack on clear\");\n\tconst popped = observerStack.pop();\n\tdebugAssert(() => popped === currentObserver || \"Mismatched observer stack\");\n\tcurrentObserver = observerStack[observerStack.length - 1];\n}\n\n/**\n * For the duration of `f`, pushes `newObserver` onto the observer stack, making it the {@link currentObserver}.\n */\nexport function withObservation<T>(newObserver: Observer | undefined, f: () => T): T {\n\tsetObserver(newObserver);\n\ttry {\n\t\treturn f();\n\t} finally {\n\t\tclearObserver();\n\t}\n}\n"]}
@@ -2,23 +2,16 @@
2
2
  * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
3
3
  * Licensed under the MIT License.
4
4
  */
5
- import type { MinimumVersionForCollab } from "@fluidframework/runtime-definitions/internal";
6
- import { type CodecTree, type CodecWriteOptions, type IJsonCodec } from "../../codec/index.js";
5
+ import { ClientVersionDispatchingCodecBuilder, type CodecWriteOptions } from "../../codec/index.js";
7
6
  import type { FieldKey, ITreeCursorSynchronous } from "../../core/index.js";
8
- import { type JsonCompatibleReadOnly } from "../../util/index.js";
9
- import type { FieldBatchCodec, FieldBatchEncodingContext } from "../chunked-forest/index.js";
10
- import { ForestFormatVersion, type Format } from "./formatCommon.js";
7
+ import { type FieldBatchEncodingContext } from "../chunked-forest/index.js";
11
8
  /**
12
9
  * Uses field cursors
13
10
  */
14
11
  export type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;
15
- export type ForestCodec = IJsonCodec<FieldSet, Format, JsonCompatibleReadOnly, FieldBatchEncodingContext>;
12
+ export type ForestCodec = ReturnType<typeof forestCodecBuilder.build>;
16
13
  /**
17
- * Convert a MinimumVersionForCollab to a ForestFormatVersion.
18
- * @param clientVersion - The MinimumVersionForCollab to convert.
19
- * @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.
14
+ * {@link ClientVersionDispatchingCodecBuilder} for forest summarizer codecs.
20
15
  */
21
- export declare function clientVersionToForestFormatVersion(clientVersion: MinimumVersionForCollab): ForestFormatVersion;
22
- export declare function makeForestSummarizerCodec(options: CodecWriteOptions, fieldBatchCodec: FieldBatchCodec): ForestCodec;
23
- export declare function getCodecTreeForForestFormat(clientVersion: MinimumVersionForCollab): CodecTree;
16
+ export declare const forestCodecBuilder: ClientVersionDispatchingCodecBuilder<"Forest", FieldSet, FieldBatchEncodingContext, import("../../util/brand.js").Brand<1, "ForestFormatVersion"> | import("../../util/brand.js").Brand<2, "ForestFormatVersion">, CodecWriteOptions>;
24
17
  //# sourceMappingURL=codec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAO5F,OAAO,EACN,KAAK,SAAS,EACd,KAAK,iBAAiB,EAEtB,KAAK,UAAU,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAS,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,KAAK,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE7F,OAAO,EAAE,mBAAmB,EAAiB,KAAK,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIpF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,UAAU,CACnC,QAAQ,EACR,MAAM,EACN,sBAAsB,EACtB,yBAAyB,CACzB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,kCAAkC,CACjD,aAAa,EAAE,uBAAuB,GACpC,mBAAmB,CAOrB;AAED,wBAAgB,yBAAyB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,eAAe,EAAE,eAAe,GAC9B,WAAW,CA2Bb;AAED,wBAAgB,2BAA2B,CAC1C,aAAa,EAAE,uBAAuB,GACpC,SAAS,CAEX"}
1
+ {"version":3,"file":"codec.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EACN,oCAAoC,EAEpC,KAAK,iBAAiB,EAEtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAEN,KAAK,yBAAyB,EAC9B,MAAM,4BAA4B,CAAC;AAIpC;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,EAAE,sBAAsB,CAAC,CAAC;AACrE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAuCtE;;GAEG;AACH,eAAO,MAAM,kBAAkB,uOAa7B,CAAC"}
@@ -3,32 +3,18 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
  import { assert, oob } from "@fluidframework/core-utils/internal";
6
- import { getConfigForMinVersionForCollab, lowestMinVersionForCollab, } from "@fluidframework/runtime-utils/internal";
7
- import { Type } from "@sinclair/typebox";
8
- import { FluidClientVersion, makeVersionedValidatedCodec, } from "../../codec/index.js";
9
- import { brand } from "../../util/index.js";
10
- import { ForestFormatVersion, validVersions } from "./formatCommon.js";
11
- import { FormatV1 } from "./formatV1.js";
12
- import { FormatV2 } from "./formatV2.js";
13
- /**
14
- * Convert a MinimumVersionForCollab to a ForestFormatVersion.
15
- * @param clientVersion - The MinimumVersionForCollab to convert.
16
- * @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.
17
- */
18
- export function clientVersionToForestFormatVersion(clientVersion) {
19
- return brand(getConfigForMinVersionForCollab(clientVersion, {
20
- [lowestMinVersionForCollab]: ForestFormatVersion.v1,
21
- [FluidClientVersion.v2_74]: ForestFormatVersion.v2,
22
- }));
23
- }
24
- export function makeForestSummarizerCodec(options, fieldBatchCodec) {
25
- const inner = fieldBatchCodec;
26
- const writeVersion = clientVersionToForestFormatVersion(options.minVersionForCollab);
27
- const formatSchema = Type.Union([FormatV1, FormatV2]);
28
- // Both the encode and decode logic here support both v1 and v2, as does `validVersions` and `formatSchema`.
29
- // This makes this use of makeVersionedValidatedCodec atypical as it is a single call being used to make a codec that supports all versions,
30
- // instead of one call per version, then using another utility to select between them based on version.
31
- return makeVersionedValidatedCodec(options, validVersions, formatSchema, {
6
+ import { lowestMinVersionForCollab } from "@fluidframework/runtime-utils/internal";
7
+ import { ClientVersionDispatchingCodecBuilder, FluidClientVersion, } from "../../codec/index.js";
8
+ import { fieldBatchCodecBuilder, } from "../chunked-forest/index.js";
9
+ import { ForestFormatVersion, FormatCommon } from "./formatCommon.js";
10
+ function makeForestSummarizerCodec(options, version) {
11
+ // Performance: Since multiple places (including multiple versions of this codec) use the field batch codec,
12
+ // we may end up with multiple copies of it, including compiling its format validation multiple times.
13
+ // This is not ideal, but is not too bad as it is a small fixed number of copies and thus should not be too expensive.
14
+ // If this becomes problematic a cache could be added for options to codec instances somewhere.
15
+ const fieldBatchCodec = fieldBatchCodecBuilder.build(options);
16
+ const formatSchema = FormatCommon;
17
+ return {
32
18
  encode: (data, context) => {
33
19
  const keys = [];
34
20
  const fields = [];
@@ -36,20 +22,37 @@ export function makeForestSummarizerCodec(options, fieldBatchCodec) {
36
22
  keys.push(key);
37
23
  fields.push(value);
38
24
  }
39
- return { keys, fields: inner.encode(fields, context), version: writeVersion };
25
+ return {
26
+ keys,
27
+ fields: fieldBatchCodec.encode(fields, context),
28
+ version,
29
+ };
40
30
  },
41
31
  decode: (data, context) => {
42
32
  const out = new Map();
43
- const fields = inner.decode(data.fields, context);
33
+ const fields = fieldBatchCodec.decode(data.fields, context);
44
34
  assert(data.keys.length === fields.length, 0x891 /* mismatched lengths */);
45
35
  for (const [index, field] of fields.entries()) {
46
36
  out.set(data.keys[index] ?? oob(), field);
47
37
  }
48
38
  return out;
49
39
  },
50
- });
51
- }
52
- export function getCodecTreeForForestFormat(clientVersion) {
53
- return { name: "Forest", version: clientVersionToForestFormatVersion(clientVersion) };
40
+ schema: formatSchema,
41
+ };
54
42
  }
43
+ /**
44
+ * {@link ClientVersionDispatchingCodecBuilder} for forest summarizer codecs.
45
+ */
46
+ export const forestCodecBuilder = ClientVersionDispatchingCodecBuilder.build("Forest", [
47
+ {
48
+ minVersionForCollab: lowestMinVersionForCollab,
49
+ formatVersion: ForestFormatVersion.v1,
50
+ codec: (options) => makeForestSummarizerCodec(options, ForestFormatVersion.v1),
51
+ },
52
+ {
53
+ minVersionForCollab: FluidClientVersion.v2_74,
54
+ formatVersion: ForestFormatVersion.v2,
55
+ codec: (options) => makeForestSummarizerCodec(options, ForestFormatVersion.v2),
56
+ },
57
+ ]);
55
58
  //# sourceMappingURL=codec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EACN,+BAA+B,EAC/B,yBAAyB,GACzB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC,OAAO,EAGN,kBAAkB,EAElB,2BAA2B,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,KAAK,EAA+B,MAAM,qBAAqB,CAAC;AAGzE,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAe,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM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CAAC;YAC7D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;YAC3E,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC/C,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;YAC3C,CAAC;YACD,OAAO,GAAG,CAAC;QACZ,CAAC;KACD,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CAC1C,aAAsC;IAEtC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,CAAC,aAAa,CAAC,EAAE,CAAC;AACvF,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport type { MinimumVersionForCollab } from \"@fluidframework/runtime-definitions/internal\";\nimport {\n\tgetConfigForMinVersionForCollab,\n\tlowestMinVersionForCollab,\n} from \"@fluidframework/runtime-utils/internal\";\nimport { Type } from \"@sinclair/typebox\";\n\nimport {\n\ttype CodecTree,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n\ttype IJsonCodec,\n\tmakeVersionedValidatedCodec,\n} from \"../../codec/index.js\";\nimport type { FieldKey, ITreeCursorSynchronous } from \"../../core/index.js\";\nimport { brand, type JsonCompatibleReadOnly } from \"../../util/index.js\";\nimport type { FieldBatchCodec, FieldBatchEncodingContext } from \"../chunked-forest/index.js\";\n\nimport { ForestFormatVersion, validVersions, type Format } from \"./formatCommon.js\";\nimport { FormatV1 } from \"./formatV1.js\";\nimport { FormatV2 } from \"./formatV2.js\";\n\n/**\n * Uses field cursors\n */\nexport type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;\nexport type ForestCodec = IJsonCodec<\n\tFieldSet,\n\tFormat,\n\tJsonCompatibleReadOnly,\n\tFieldBatchEncodingContext\n>;\n\n/**\n * Convert a MinimumVersionForCollab to a ForestFormatVersion.\n * @param clientVersion - The MinimumVersionForCollab to convert.\n * @returns The ForestFormatVersion that corresponds to the provided MinimumVersionForCollab.\n */\nexport function clientVersionToForestFormatVersion(\n\tclientVersion: MinimumVersionForCollab,\n): ForestFormatVersion {\n\treturn brand(\n\t\tgetConfigForMinVersionForCollab(clientVersion, {\n\t\t\t[lowestMinVersionForCollab]: ForestFormatVersion.v1,\n\t\t\t[FluidClientVersion.v2_74]: ForestFormatVersion.v2,\n\t\t}),\n\t);\n}\n\nexport function makeForestSummarizerCodec(\n\toptions: CodecWriteOptions,\n\tfieldBatchCodec: FieldBatchCodec,\n): ForestCodec {\n\tconst inner = fieldBatchCodec;\n\tconst writeVersion = clientVersionToForestFormatVersion(options.minVersionForCollab);\n\tconst formatSchema = Type.Union([FormatV1, FormatV2]);\n\t// Both the encode and decode logic here support both v1 and v2, as does `validVersions` and `formatSchema`.\n\t// This makes this use of makeVersionedValidatedCodec atypical as it is a single call being used to make a codec that supports all versions,\n\t// instead of one call per version, then using another utility to select between them based on version.\n\treturn makeVersionedValidatedCodec(options, validVersions, formatSchema, {\n\t\tencode: (data: FieldSet, context: FieldBatchEncodingContext): Format => {\n\t\t\tconst keys: FieldKey[] = [];\n\t\t\tconst fields: ITreeCursorSynchronous[] = [];\n\t\t\tfor (const [key, value] of data) {\n\t\t\t\tkeys.push(key);\n\t\t\t\tfields.push(value);\n\t\t\t}\n\t\t\treturn { keys, fields: inner.encode(fields, context), version: writeVersion };\n\t\t},\n\t\tdecode: (data: Format, context: FieldBatchEncodingContext): FieldSet => {\n\t\t\tconst out: Map<FieldKey, ITreeCursorSynchronous> = new Map();\n\t\t\tconst fields = inner.decode(data.fields, context);\n\t\t\tassert(data.keys.length === fields.length, 0x891 /* mismatched lengths */);\n\t\t\tfor (const [index, field] of fields.entries()) {\n\t\t\t\tout.set(data.keys[index] ?? oob(), field);\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t});\n}\n\nexport function getCodecTreeForForestFormat(\n\tclientVersion: MinimumVersionForCollab,\n): CodecTree {\n\treturn { name: \"Forest\", version: clientVersionToForestFormatVersion(clientVersion) };\n}\n"]}
1
+ {"version":3,"file":"codec.js","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/codec.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,qCAAqC,CAAC;AAClE,OAAO,EAAE,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEnF,OAAO,EACN,oCAAoC,EAGpC,kBAAkB,GAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACN,sBAAsB,GAEtB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQtE,SAAS,yBAAyB,CACjC,OAA0B,EAC1B,OAA4B;IAE5B,4GAA4G;IAC5G,sGAAsG;IACtG,sHAAsH;IACtH,+FAA+F;IAC/F,MAAM,eAAe,GAAG,sBAAsB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC9D,MAAM,YAAY,GAAG,YAAY,CAAC;IAClC,OAAO;QACN,MAAM,EAAE,CAAC,IAAc,EAAE,OAAkC,EAAgB,EAAE;YAC5E,MAAM,IAAI,GAAe,EAAE,CAAC;YAC5B,MAAM,MAAM,GAA6B,EAAE,CAAC;YAC5C,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;gBACjC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACf,MAAM,CAAC,IAAI,CAAC,KAAK,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CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { assert, oob } from \"@fluidframework/core-utils/internal\";\nimport { lowestMinVersionForCollab } from \"@fluidframework/runtime-utils/internal\";\n\nimport {\n\tClientVersionDispatchingCodecBuilder,\n\ttype CodecAndSchema,\n\ttype CodecWriteOptions,\n\tFluidClientVersion,\n} from \"../../codec/index.js\";\nimport type { FieldKey, ITreeCursorSynchronous } from \"../../core/index.js\";\nimport {\n\tfieldBatchCodecBuilder,\n\ttype FieldBatchEncodingContext,\n} from \"../chunked-forest/index.js\";\n\nimport { ForestFormatVersion, FormatCommon } from \"./formatCommon.js\";\n\n/**\n * Uses field cursors\n */\nexport type FieldSet = ReadonlyMap<FieldKey, ITreeCursorSynchronous>;\nexport type ForestCodec = ReturnType<typeof forestCodecBuilder.build>;\n\nfunction makeForestSummarizerCodec(\n\toptions: CodecWriteOptions,\n\tversion: ForestFormatVersion,\n): CodecAndSchema<FieldSet, FieldBatchEncodingContext> {\n\t// Performance: Since multiple places (including multiple versions of this codec) use the field batch codec,\n\t// we may end up with multiple copies of it, including compiling its format validation multiple times.\n\t// This is not ideal, but is not too bad as it is a small fixed number of copies and thus should not be too expensive.\n\t// If this becomes problematic a cache could be added for options to codec instances somewhere.\n\tconst fieldBatchCodec = fieldBatchCodecBuilder.build(options);\n\tconst formatSchema = FormatCommon;\n\treturn {\n\t\tencode: (data: FieldSet, context: FieldBatchEncodingContext): FormatCommon => {\n\t\t\tconst keys: FieldKey[] = [];\n\t\t\tconst fields: ITreeCursorSynchronous[] = [];\n\t\t\tfor (const [key, value] of data) {\n\t\t\t\tkeys.push(key);\n\t\t\t\tfields.push(value);\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tkeys,\n\t\t\t\tfields: fieldBatchCodec.encode(fields, context),\n\t\t\t\tversion,\n\t\t\t};\n\t\t},\n\t\tdecode: (data: FormatCommon, context: FieldBatchEncodingContext): FieldSet => {\n\t\t\tconst out: Map<FieldKey, ITreeCursorSynchronous> = new Map();\n\t\t\tconst fields = fieldBatchCodec.decode(data.fields, context);\n\t\t\tassert(data.keys.length === fields.length, 0x891 /* mismatched lengths */);\n\t\t\tfor (const [index, field] of fields.entries()) {\n\t\t\t\tout.set(data.keys[index] ?? oob(), field);\n\t\t\t}\n\t\t\treturn out;\n\t\t},\n\t\tschema: formatSchema,\n\t};\n}\n\n/**\n * {@link ClientVersionDispatchingCodecBuilder} for forest summarizer codecs.\n */\nexport const forestCodecBuilder = ClientVersionDispatchingCodecBuilder.build(\"Forest\", [\n\t{\n\t\tminVersionForCollab: lowestMinVersionForCollab,\n\t\tformatVersion: ForestFormatVersion.v1,\n\t\tcodec: (options: CodecWriteOptions) =>\n\t\t\tmakeForestSummarizerCodec(options, ForestFormatVersion.v1),\n\t},\n\t{\n\t\tminVersionForCollab: FluidClientVersion.v2_74,\n\t\tformatVersion: ForestFormatVersion.v2,\n\t\tcodec: (options: CodecWriteOptions) =>\n\t\t\tmakeForestSummarizerCodec(options, ForestFormatVersion.v2),\n\t},\n]);\n"]}
@@ -9,7 +9,7 @@ import type { SummaryTreeBuilder } from "@fluidframework/runtime-utils/internal"
9
9
  import type { CodecWriteOptions } from "../../codec/index.js";
10
10
  import { type IEditableForest, type RevisionTagCodec } from "../../core/index.js";
11
11
  import { VersionedSummarizer, type Summarizable, type SummaryElementParser, type SummaryElementStringifier } from "../../shared-tree-core/index.js";
12
- import { type FieldBatchCodec, type FieldBatchEncodingContext, type IncrementalEncodingPolicy } from "../chunked-forest/index.js";
12
+ import { type FieldBatchEncodingContext, type IncrementalEncodingPolicy } from "../chunked-forest/index.js";
13
13
  import { ForestSummaryFormatVersion } from "./summaryFormatCommon.js";
14
14
  /**
15
15
  * Provides methods for summarizing and loading a forest.
@@ -25,7 +25,7 @@ export declare class ForestSummarizer extends VersionedSummarizer<ForestSummaryF
25
25
  /**
26
26
  * @param encoderContext - The schema if provided here must be mutated by the caller to keep it up to date.
27
27
  */
28
- constructor(forest: IEditableForest, revisionTagCodec: RevisionTagCodec, fieldBatchCodec: FieldBatchCodec, encoderContext: FieldBatchEncodingContext, options: CodecWriteOptions, idCompressor: IIdCompressor, initialSequenceNumber: number, shouldEncodeIncrementally?: IncrementalEncodingPolicy);
28
+ constructor(forest: IEditableForest, revisionTagCodec: RevisionTagCodec, encoderContext: FieldBatchEncodingContext, options: CodecWriteOptions, idCompressor: IIdCompressor, initialSequenceNumber: number, shouldEncodeIncrementally?: IncrementalEncodingPolicy);
29
29
  /**
30
30
  * Summarization of the forest's tree content.
31
31
  * @returns a summary tree containing the forest's tree content.
@@ -1 +1 @@
1
- {"version":3,"file":"forestSummarizer.d.ts","sourceRoot":"","sources":["../../../src/feature-libraries/forest-summary/forestSummarizer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EACX,sCAAsC,EACtC,iBAAiB,EACjB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAEjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAIN,KAAK,eAAe,EAGpB,KAAK,gBAAgB,EAKrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACN,mBAAmB,EACnB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAC9B,MAAM,4BAA4B,CAAC;AAapC,OAAO,EACN,0BAA0B,EAG1B,MAAM,0BAA0B,CAAC;AAMlC;;GAEG;AACH,qBAAa,gBACZ,SAAQ,mBAAmB,CAAC,0BAA0B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