@fluidframework/tree 2.116.1 → 2.118.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 (421) hide show
  1. package/CHANGELOG.md +202 -0
  2. package/api-report/tree.alpha.api.md +122 -31
  3. package/api-report/tree.beta.api.md +50 -9
  4. package/api-report/tree.legacy.beta.api.md +50 -9
  5. package/dist/codec/codec.d.ts +18 -0
  6. package/dist/codec/codec.d.ts.map +1 -1
  7. package/dist/codec/codec.js +18 -0
  8. package/dist/codec/codec.js.map +1 -1
  9. package/dist/core/index.d.ts +2 -2
  10. package/dist/core/index.d.ts.map +1 -1
  11. package/dist/core/index.js +3 -2
  12. package/dist/core/index.js.map +1 -1
  13. package/dist/core/rebase/index.d.ts +1 -1
  14. package/dist/core/rebase/index.d.ts.map +1 -1
  15. package/dist/core/rebase/index.js +2 -1
  16. package/dist/core/rebase/index.js.map +1 -1
  17. package/dist/core/rebase/types.d.ts +39 -2
  18. package/dist/core/rebase/types.d.ts.map +1 -1
  19. package/dist/core/rebase/types.js +37 -2
  20. package/dist/core/rebase/types.js.map +1 -1
  21. package/dist/core/rebase/utils.d.ts.map +1 -1
  22. package/dist/core/rebase/utils.js +1 -0
  23. package/dist/core/rebase/utils.js.map +1 -1
  24. package/dist/core/revertible.d.ts +62 -6
  25. package/dist/core/revertible.d.ts.map +1 -1
  26. package/dist/core/revertible.js.map +1 -1
  27. package/dist/entrypoints/alpha.d.ts +1 -1
  28. package/dist/entrypoints/alpha.d.ts.map +1 -1
  29. package/dist/entrypoints/alpha.js.map +1 -1
  30. package/dist/entrypoints/beta.d.ts +1 -1
  31. package/dist/entrypoints/beta.d.ts.map +1 -1
  32. package/dist/entrypoints/beta.js.map +1 -1
  33. package/dist/entrypoints/legacy.d.ts +1 -1
  34. package/dist/entrypoints/legacy.d.ts.map +1 -1
  35. package/dist/entrypoints/legacy.js.map +1 -1
  36. package/dist/feature-libraries/index.d.ts +1 -1
  37. package/dist/feature-libraries/index.js.map +1 -1
  38. package/dist/feature-libraries/indexing/types.d.ts +1 -1
  39. package/dist/feature-libraries/indexing/types.js.map +1 -1
  40. package/dist/feature-libraries/schemaChecker.d.ts +9 -19
  41. package/dist/feature-libraries/schemaChecker.d.ts.map +1 -1
  42. package/dist/feature-libraries/schemaChecker.js +130 -46
  43. package/dist/feature-libraries/schemaChecker.js.map +1 -1
  44. package/dist/index.d.ts +2 -2
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/index.js.map +1 -1
  47. package/dist/packageVersion.d.ts +1 -1
  48. package/dist/packageVersion.js +1 -1
  49. package/dist/packageVersion.js.map +1 -1
  50. package/dist/shared-tree/history.d.ts +22 -0
  51. package/dist/shared-tree/history.d.ts.map +1 -0
  52. package/dist/shared-tree/history.js +66 -0
  53. package/dist/shared-tree/history.js.map +1 -0
  54. package/dist/shared-tree/schematizingTreeView.d.ts +24 -9
  55. package/dist/shared-tree/schematizingTreeView.d.ts.map +1 -1
  56. package/dist/shared-tree/schematizingTreeView.js +61 -11
  57. package/dist/shared-tree/schematizingTreeView.js.map +1 -1
  58. package/dist/shared-tree/sharedTree.d.ts +3 -2
  59. package/dist/shared-tree/sharedTree.d.ts.map +1 -1
  60. package/dist/shared-tree/sharedTree.js +2 -0
  61. package/dist/shared-tree/sharedTree.js.map +1 -1
  62. package/dist/shared-tree/tree.js +1 -1
  63. package/dist/shared-tree/tree.js.map +1 -1
  64. package/dist/shared-tree/treeAlpha.d.ts +8 -20
  65. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  66. package/dist/shared-tree/treeAlpha.js +9 -12
  67. package/dist/shared-tree/treeAlpha.js.map +1 -1
  68. package/dist/shared-tree/treeCheckout.d.ts +16 -9
  69. package/dist/shared-tree/treeCheckout.d.ts.map +1 -1
  70. package/dist/shared-tree/treeCheckout.js +122 -25
  71. package/dist/shared-tree/treeCheckout.js.map +1 -1
  72. package/dist/shared-tree/unhydratedTreeContext.d.ts +3 -2
  73. package/dist/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  74. package/dist/shared-tree/unhydratedTreeContext.js +3 -0
  75. package/dist/shared-tree/unhydratedTreeContext.js.map +1 -1
  76. package/dist/shared-tree-core/branch.d.ts +16 -2
  77. package/dist/shared-tree-core/branch.d.ts.map +1 -1
  78. package/dist/shared-tree-core/branch.js +20 -2
  79. package/dist/shared-tree-core/branch.js.map +1 -1
  80. package/dist/shared-tree-core/branchCommitCounter.d.ts +31 -0
  81. package/dist/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
  82. package/dist/shared-tree-core/branchCommitCounter.js +79 -0
  83. package/dist/shared-tree-core/branchCommitCounter.js.map +1 -0
  84. package/dist/shared-tree-core/customMetadataCodec.d.ts +9 -0
  85. package/dist/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
  86. package/dist/shared-tree-core/customMetadataCodec.js +37 -0
  87. package/dist/shared-tree-core/customMetadataCodec.js.map +1 -0
  88. package/dist/shared-tree-core/customMetadataFormat.d.ts +18 -0
  89. package/dist/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
  90. package/dist/shared-tree-core/customMetadataFormat.js +15 -0
  91. package/dist/shared-tree-core/customMetadataFormat.js.map +1 -0
  92. package/dist/shared-tree-core/editManager.d.ts.map +1 -1
  93. package/dist/shared-tree-core/editManager.js +15 -3
  94. package/dist/shared-tree-core/editManager.js.map +1 -1
  95. package/dist/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  96. package/dist/shared-tree-core/editManagerCodecs.js +5 -0
  97. package/dist/shared-tree-core/editManagerCodecs.js.map +1 -1
  98. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  99. package/dist/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  100. package/dist/shared-tree-core/editManagerCodecsCommons.js +17 -5
  101. package/dist/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  102. package/dist/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  103. package/dist/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
  104. package/dist/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  105. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  106. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
  107. package/dist/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  108. package/dist/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
  109. package/dist/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  110. package/dist/shared-tree-core/editManagerFormatCommons.js +18 -8
  111. package/dist/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  112. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
  113. package/dist/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  114. package/dist/shared-tree-core/editManagerFormatV1toV4.js +4 -3
  115. package/dist/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  116. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
  117. package/dist/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  118. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
  119. package/dist/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  120. package/dist/shared-tree-core/index.d.ts +2 -1
  121. package/dist/shared-tree-core/index.d.ts.map +1 -1
  122. package/dist/shared-tree-core/index.js +3 -1
  123. package/dist/shared-tree-core/index.js.map +1 -1
  124. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  125. package/dist/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  126. package/dist/shared-tree-core/messageCodecV1ToV4.js +12 -3
  127. package/dist/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  128. package/dist/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  129. package/dist/shared-tree-core/messageCodecVSharedBranches.js +8 -2
  130. package/dist/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  131. package/dist/shared-tree-core/messageCodecs.d.ts.map +1 -1
  132. package/dist/shared-tree-core/messageCodecs.js +5 -0
  133. package/dist/shared-tree-core/messageCodecs.js.map +1 -1
  134. package/dist/shared-tree-core/messageFormat.d.ts +1 -0
  135. package/dist/shared-tree-core/messageFormat.d.ts.map +1 -1
  136. package/dist/shared-tree-core/messageFormat.js +6 -0
  137. package/dist/shared-tree-core/messageFormat.js.map +1 -1
  138. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
  139. package/dist/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  140. package/dist/shared-tree-core/messageFormatV1ToV4.js +10 -2
  141. package/dist/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  142. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
  143. package/dist/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  144. package/dist/shared-tree-core/messageFormatVSharedBranches.js +2 -0
  145. package/dist/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  146. package/dist/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  147. package/dist/shared-tree-core/sharedTreeCore.js +4 -2
  148. package/dist/shared-tree-core/sharedTreeCore.js.map +1 -1
  149. package/dist/shared-tree-core/transaction.d.ts +9 -0
  150. package/dist/shared-tree-core/transaction.d.ts.map +1 -1
  151. package/dist/shared-tree-core/transaction.js +26 -4
  152. package/dist/shared-tree-core/transaction.js.map +1 -1
  153. package/dist/simple-tree/api/configuration.d.ts +4 -4
  154. package/dist/simple-tree/api/configuration.d.ts.map +1 -1
  155. package/dist/simple-tree/api/configuration.js.map +1 -1
  156. package/dist/simple-tree/api/discrepancies.d.ts +36 -3
  157. package/dist/simple-tree/api/discrepancies.d.ts.map +1 -1
  158. package/dist/simple-tree/api/discrepancies.js +40 -14
  159. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  160. package/dist/simple-tree/api/index.d.ts +3 -2
  161. package/dist/simple-tree/api/index.d.ts.map +1 -1
  162. package/dist/simple-tree/api/index.js +3 -2
  163. package/dist/simple-tree/api/index.js.map +1 -1
  164. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
  165. package/dist/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  166. package/dist/simple-tree/api/schemaCompatibilityTester.js +140 -10
  167. package/dist/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  168. package/dist/simple-tree/api/transactionTypes.d.ts +28 -2
  169. package/dist/simple-tree/api/transactionTypes.d.ts.map +1 -1
  170. package/dist/simple-tree/api/transactionTypes.js.map +1 -1
  171. package/dist/simple-tree/api/tree.d.ts +353 -68
  172. package/dist/simple-tree/api/tree.d.ts.map +1 -1
  173. package/dist/simple-tree/api/tree.js.map +1 -1
  174. package/dist/simple-tree/core/toStored.d.ts +7 -0
  175. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  176. package/dist/simple-tree/core/toStored.js.map +1 -1
  177. package/dist/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  178. package/dist/simple-tree/core/treeNodeValid.js +2 -2
  179. package/dist/simple-tree/core/treeNodeValid.js.map +1 -1
  180. package/dist/simple-tree/index.d.ts +1 -1
  181. package/dist/simple-tree/index.d.ts.map +1 -1
  182. package/dist/simple-tree/index.js +4 -3
  183. package/dist/simple-tree/index.js.map +1 -1
  184. package/dist/tableSchema.js +10 -10
  185. package/dist/tableSchema.js.map +1 -1
  186. package/docs/main/glossary.md +163 -0
  187. package/lib/codec/codec.d.ts +18 -0
  188. package/lib/codec/codec.d.ts.map +1 -1
  189. package/lib/codec/codec.js +18 -0
  190. package/lib/codec/codec.js.map +1 -1
  191. package/lib/core/index.d.ts +2 -2
  192. package/lib/core/index.d.ts.map +1 -1
  193. package/lib/core/index.js +1 -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 +1 -1
  198. package/lib/core/rebase/index.js.map +1 -1
  199. package/lib/core/rebase/types.d.ts +39 -2
  200. package/lib/core/rebase/types.d.ts.map +1 -1
  201. package/lib/core/rebase/types.js +35 -1
  202. package/lib/core/rebase/types.js.map +1 -1
  203. package/lib/core/rebase/utils.d.ts.map +1 -1
  204. package/lib/core/rebase/utils.js +1 -0
  205. package/lib/core/rebase/utils.js.map +1 -1
  206. package/lib/core/revertible.d.ts +62 -6
  207. package/lib/core/revertible.d.ts.map +1 -1
  208. package/lib/core/revertible.js.map +1 -1
  209. package/lib/entrypoints/alpha.d.ts +1 -1
  210. package/lib/entrypoints/alpha.d.ts.map +1 -1
  211. package/lib/entrypoints/alpha.js.map +1 -1
  212. package/lib/entrypoints/beta.d.ts +1 -1
  213. package/lib/entrypoints/beta.d.ts.map +1 -1
  214. package/lib/entrypoints/beta.js.map +1 -1
  215. package/lib/entrypoints/legacy.d.ts +1 -1
  216. package/lib/entrypoints/legacy.d.ts.map +1 -1
  217. package/lib/entrypoints/legacy.js.map +1 -1
  218. package/lib/feature-libraries/index.d.ts +1 -1
  219. package/lib/feature-libraries/index.js.map +1 -1
  220. package/lib/feature-libraries/indexing/types.d.ts +1 -1
  221. package/lib/feature-libraries/indexing/types.js.map +1 -1
  222. package/lib/feature-libraries/schemaChecker.d.ts +9 -19
  223. package/lib/feature-libraries/schemaChecker.d.ts.map +1 -1
  224. package/lib/feature-libraries/schemaChecker.js +133 -49
  225. package/lib/feature-libraries/schemaChecker.js.map +1 -1
  226. package/lib/index.d.ts +2 -2
  227. package/lib/index.d.ts.map +1 -1
  228. package/lib/index.js.map +1 -1
  229. package/lib/packageVersion.d.ts +1 -1
  230. package/lib/packageVersion.js +1 -1
  231. package/lib/packageVersion.js.map +1 -1
  232. package/lib/shared-tree/history.d.ts +22 -0
  233. package/lib/shared-tree/history.d.ts.map +1 -0
  234. package/lib/shared-tree/history.js +62 -0
  235. package/lib/shared-tree/history.js.map +1 -0
  236. package/lib/shared-tree/schematizingTreeView.d.ts +24 -9
  237. package/lib/shared-tree/schematizingTreeView.d.ts.map +1 -1
  238. package/lib/shared-tree/schematizingTreeView.js +62 -12
  239. package/lib/shared-tree/schematizingTreeView.js.map +1 -1
  240. package/lib/shared-tree/sharedTree.d.ts +3 -2
  241. package/lib/shared-tree/sharedTree.d.ts.map +1 -1
  242. package/lib/shared-tree/sharedTree.js +2 -0
  243. package/lib/shared-tree/sharedTree.js.map +1 -1
  244. package/lib/shared-tree/tree.js +1 -1
  245. package/lib/shared-tree/tree.js.map +1 -1
  246. package/lib/shared-tree/treeAlpha.d.ts +8 -20
  247. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  248. package/lib/shared-tree/treeAlpha.js +9 -12
  249. package/lib/shared-tree/treeAlpha.js.map +1 -1
  250. package/lib/shared-tree/treeCheckout.d.ts +16 -9
  251. package/lib/shared-tree/treeCheckout.d.ts.map +1 -1
  252. package/lib/shared-tree/treeCheckout.js +123 -26
  253. package/lib/shared-tree/treeCheckout.js.map +1 -1
  254. package/lib/shared-tree/unhydratedTreeContext.d.ts +3 -2
  255. package/lib/shared-tree/unhydratedTreeContext.d.ts.map +1 -1
  256. package/lib/shared-tree/unhydratedTreeContext.js +3 -0
  257. package/lib/shared-tree/unhydratedTreeContext.js.map +1 -1
  258. package/lib/shared-tree-core/branch.d.ts +16 -2
  259. package/lib/shared-tree-core/branch.d.ts.map +1 -1
  260. package/lib/shared-tree-core/branch.js +20 -2
  261. package/lib/shared-tree-core/branch.js.map +1 -1
  262. package/lib/shared-tree-core/branchCommitCounter.d.ts +31 -0
  263. package/lib/shared-tree-core/branchCommitCounter.d.ts.map +1 -0
  264. package/lib/shared-tree-core/branchCommitCounter.js +75 -0
  265. package/lib/shared-tree-core/branchCommitCounter.js.map +1 -0
  266. package/lib/shared-tree-core/customMetadataCodec.d.ts +9 -0
  267. package/lib/shared-tree-core/customMetadataCodec.d.ts.map +1 -0
  268. package/lib/shared-tree-core/customMetadataCodec.js +32 -0
  269. package/lib/shared-tree-core/customMetadataCodec.js.map +1 -0
  270. package/lib/shared-tree-core/customMetadataFormat.d.ts +18 -0
  271. package/lib/shared-tree-core/customMetadataFormat.d.ts.map +1 -0
  272. package/lib/shared-tree-core/customMetadataFormat.js +11 -0
  273. package/lib/shared-tree-core/customMetadataFormat.js.map +1 -0
  274. package/lib/shared-tree-core/editManager.d.ts.map +1 -1
  275. package/lib/shared-tree-core/editManager.js +16 -4
  276. package/lib/shared-tree-core/editManager.js.map +1 -1
  277. package/lib/shared-tree-core/editManagerCodecs.d.ts.map +1 -1
  278. package/lib/shared-tree-core/editManagerCodecs.js +5 -0
  279. package/lib/shared-tree-core/editManagerCodecs.js.map +1 -1
  280. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts +1 -1
  281. package/lib/shared-tree-core/editManagerCodecsCommons.d.ts.map +1 -1
  282. package/lib/shared-tree-core/editManagerCodecsCommons.js +17 -5
  283. package/lib/shared-tree-core/editManagerCodecsCommons.js.map +1 -1
  284. package/lib/shared-tree-core/editManagerCodecsV1toV4.d.ts.map +1 -1
  285. package/lib/shared-tree-core/editManagerCodecsV1toV4.js +4 -2
  286. package/lib/shared-tree-core/editManagerCodecsV1toV4.js.map +1 -1
  287. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.d.ts.map +1 -1
  288. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js +2 -2
  289. package/lib/shared-tree-core/editManagerCodecsVSharedBranches.js.map +1 -1
  290. package/lib/shared-tree-core/editManagerFormatCommons.d.ts +17 -6
  291. package/lib/shared-tree-core/editManagerFormatCommons.d.ts.map +1 -1
  292. package/lib/shared-tree-core/editManagerFormatCommons.js +18 -8
  293. package/lib/shared-tree-core/editManagerFormatCommons.js.map +1 -1
  294. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts +7 -5
  295. package/lib/shared-tree-core/editManagerFormatV1toV4.d.ts.map +1 -1
  296. package/lib/shared-tree-core/editManagerFormatV1toV4.js +4 -3
  297. package/lib/shared-tree-core/editManagerFormatV1toV4.js.map +1 -1
  298. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts +4 -0
  299. package/lib/shared-tree-core/editManagerFormatVSharedBranches.d.ts.map +1 -1
  300. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js +2 -2
  301. package/lib/shared-tree-core/editManagerFormatVSharedBranches.js.map +1 -1
  302. package/lib/shared-tree-core/index.d.ts +2 -1
  303. package/lib/shared-tree-core/index.d.ts.map +1 -1
  304. package/lib/shared-tree-core/index.js +1 -0
  305. package/lib/shared-tree-core/index.js.map +1 -1
  306. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts +2 -2
  307. package/lib/shared-tree-core/messageCodecV1ToV4.d.ts.map +1 -1
  308. package/lib/shared-tree-core/messageCodecV1ToV4.js +12 -3
  309. package/lib/shared-tree-core/messageCodecV1ToV4.js.map +1 -1
  310. package/lib/shared-tree-core/messageCodecVSharedBranches.d.ts.map +1 -1
  311. package/lib/shared-tree-core/messageCodecVSharedBranches.js +8 -2
  312. package/lib/shared-tree-core/messageCodecVSharedBranches.js.map +1 -1
  313. package/lib/shared-tree-core/messageCodecs.d.ts.map +1 -1
  314. package/lib/shared-tree-core/messageCodecs.js +5 -0
  315. package/lib/shared-tree-core/messageCodecs.js.map +1 -1
  316. package/lib/shared-tree-core/messageFormat.d.ts +1 -0
  317. package/lib/shared-tree-core/messageFormat.d.ts.map +1 -1
  318. package/lib/shared-tree-core/messageFormat.js +6 -0
  319. package/lib/shared-tree-core/messageFormat.js.map +1 -1
  320. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts +10 -3
  321. package/lib/shared-tree-core/messageFormatV1ToV4.d.ts.map +1 -1
  322. package/lib/shared-tree-core/messageFormatV1ToV4.js +10 -2
  323. package/lib/shared-tree-core/messageFormatV1ToV4.js.map +1 -1
  324. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts +7 -0
  325. package/lib/shared-tree-core/messageFormatVSharedBranches.d.ts.map +1 -1
  326. package/lib/shared-tree-core/messageFormatVSharedBranches.js +2 -0
  327. package/lib/shared-tree-core/messageFormatVSharedBranches.js.map +1 -1
  328. package/lib/shared-tree-core/sharedTreeCore.d.ts.map +1 -1
  329. package/lib/shared-tree-core/sharedTreeCore.js +5 -3
  330. package/lib/shared-tree-core/sharedTreeCore.js.map +1 -1
  331. package/lib/shared-tree-core/transaction.d.ts +9 -0
  332. package/lib/shared-tree-core/transaction.d.ts.map +1 -1
  333. package/lib/shared-tree-core/transaction.js +27 -5
  334. package/lib/shared-tree-core/transaction.js.map +1 -1
  335. package/lib/simple-tree/api/configuration.d.ts +4 -4
  336. package/lib/simple-tree/api/configuration.d.ts.map +1 -1
  337. package/lib/simple-tree/api/configuration.js.map +1 -1
  338. package/lib/simple-tree/api/discrepancies.d.ts +36 -3
  339. package/lib/simple-tree/api/discrepancies.d.ts.map +1 -1
  340. package/lib/simple-tree/api/discrepancies.js +40 -14
  341. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  342. package/lib/simple-tree/api/index.d.ts +3 -2
  343. package/lib/simple-tree/api/index.d.ts.map +1 -1
  344. package/lib/simple-tree/api/index.js +1 -1
  345. package/lib/simple-tree/api/index.js.map +1 -1
  346. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts +22 -3
  347. package/lib/simple-tree/api/schemaCompatibilityTester.d.ts.map +1 -1
  348. package/lib/simple-tree/api/schemaCompatibilityTester.js +136 -7
  349. package/lib/simple-tree/api/schemaCompatibilityTester.js.map +1 -1
  350. package/lib/simple-tree/api/transactionTypes.d.ts +28 -2
  351. package/lib/simple-tree/api/transactionTypes.d.ts.map +1 -1
  352. package/lib/simple-tree/api/transactionTypes.js.map +1 -1
  353. package/lib/simple-tree/api/tree.d.ts +353 -68
  354. package/lib/simple-tree/api/tree.d.ts.map +1 -1
  355. package/lib/simple-tree/api/tree.js.map +1 -1
  356. package/lib/simple-tree/core/toStored.d.ts +7 -0
  357. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  358. package/lib/simple-tree/core/toStored.js.map +1 -1
  359. package/lib/simple-tree/core/treeNodeValid.d.ts.map +1 -1
  360. package/lib/simple-tree/core/treeNodeValid.js +3 -3
  361. package/lib/simple-tree/core/treeNodeValid.js.map +1 -1
  362. package/lib/simple-tree/index.d.ts +1 -1
  363. package/lib/simple-tree/index.d.ts.map +1 -1
  364. package/lib/simple-tree/index.js +1 -1
  365. package/lib/simple-tree/index.js.map +1 -1
  366. package/lib/tableSchema.js +10 -10
  367. package/lib/tableSchema.js.map +1 -1
  368. package/package.json +22 -22
  369. package/src/codec/codec.ts +19 -0
  370. package/src/core/index.ts +4 -0
  371. package/src/core/rebase/index.ts +2 -0
  372. package/src/core/rebase/types.ts +72 -2
  373. package/src/core/rebase/utils.ts +1 -0
  374. package/src/core/revertible.ts +67 -6
  375. package/src/entrypoints/alpha.ts +11 -0
  376. package/src/entrypoints/beta.ts +3 -0
  377. package/src/entrypoints/legacy.ts +3 -0
  378. package/src/feature-libraries/index.ts +1 -1
  379. package/src/feature-libraries/indexing/types.ts +1 -1
  380. package/src/feature-libraries/schemaChecker.ts +198 -82
  381. package/src/index.ts +11 -0
  382. package/src/packageVersion.ts +1 -1
  383. package/src/shared-tree/history.ts +99 -0
  384. package/src/shared-tree/schematizingTreeView.ts +100 -29
  385. package/src/shared-tree/sharedTree.ts +5 -2
  386. package/src/shared-tree/tree.ts +1 -1
  387. package/src/shared-tree/treeAlpha.ts +17 -35
  388. package/src/shared-tree/treeCheckout.ts +170 -31
  389. package/src/shared-tree/unhydratedTreeContext.ts +6 -2
  390. package/src/shared-tree-core/branch.ts +34 -2
  391. package/src/shared-tree-core/branchCommitCounter.ts +103 -0
  392. package/src/shared-tree-core/customMetadataCodec.ts +42 -0
  393. package/src/shared-tree-core/customMetadataFormat.ts +39 -0
  394. package/src/shared-tree-core/editManager.ts +22 -3
  395. package/src/shared-tree-core/editManagerCodecs.ts +12 -0
  396. package/src/shared-tree-core/editManagerCodecsCommons.ts +41 -15
  397. package/src/shared-tree-core/editManagerCodecsV1toV4.ts +7 -1
  398. package/src/shared-tree-core/editManagerCodecsVSharedBranches.ts +2 -0
  399. package/src/shared-tree-core/editManagerFormatCommons.ts +46 -12
  400. package/src/shared-tree-core/editManagerFormatV1toV4.ts +13 -5
  401. package/src/shared-tree-core/editManagerFormatVSharedBranches.ts +2 -2
  402. package/src/shared-tree-core/index.ts +3 -0
  403. package/src/shared-tree-core/messageCodecV1ToV4.ts +18 -5
  404. package/src/shared-tree-core/messageCodecVSharedBranches.ts +9 -2
  405. package/src/shared-tree-core/messageCodecs.ts +12 -0
  406. package/src/shared-tree-core/messageFormat.ts +6 -0
  407. package/src/shared-tree-core/messageFormatV1ToV4.ts +21 -3
  408. package/src/shared-tree-core/messageFormatVSharedBranches.ts +8 -0
  409. package/src/shared-tree-core/sharedTreeCore.ts +5 -2
  410. package/src/shared-tree-core/transaction.ts +56 -4
  411. package/src/simple-tree/api/configuration.ts +4 -4
  412. package/src/simple-tree/api/discrepancies.ts +100 -5
  413. package/src/simple-tree/api/index.ts +12 -1
  414. package/src/simple-tree/api/schemaCompatibilityTester.ts +185 -11
  415. package/src/simple-tree/api/transactionTypes.ts +29 -2
  416. package/src/simple-tree/api/tree.ts +384 -68
  417. package/src/simple-tree/core/toStored.ts +8 -0
  418. package/src/simple-tree/core/treeNodeValid.ts +3 -1
  419. package/src/simple-tree/index.ts +9 -0
  420. package/src/tableSchema.ts +9 -9
  421. package/docs/main/runtime-schema-upgrade.md +0 -208
@@ -10,9 +10,9 @@ import type {
10
10
  Listenable,
11
11
  } from "@fluidframework/core-interfaces/internal";
12
12
  import { assert } from "@fluidframework/core-utils/internal";
13
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
13
+ import { tagSchemaArtifacts, UsageError } from "@fluidframework/telemetry-utils/internal";
14
14
 
15
- import { anchorSlot, rootFieldKey } from "../core/index.js";
15
+ import { anchorSlot, rootFieldKey, type RevertToOptionsAlpha } from "../core/index.js";
16
16
  import {
17
17
  type NodeIdentifierManager,
18
18
  defaultSchemaPolicy,
@@ -27,7 +27,7 @@ import {
27
27
  } from "../feature-libraries/index.js";
28
28
  import {
29
29
  type ImplicitFieldSchema,
30
- type SchemaCompatibilityStatus,
30
+ type SchemaCompatibilityStatusBeta,
31
31
  type TreeView,
32
32
  type TreeViewEvents,
33
33
  tryGetTreeNodeForField,
@@ -58,8 +58,11 @@ import {
58
58
  TreeViewConfigurationAlpha,
59
59
  toInitialSchema,
60
60
  toUpgradeSchema,
61
- type TreeBranchAlpha,
61
+ type TreeBranchHistory,
62
+ type UntypedTreeViewAlpha,
62
63
  type TreeSchema,
64
+ type SchemaUpgrade,
65
+ type StagedUpgradeStatus,
63
66
  } from "../simple-tree/index.js";
64
67
  import {
65
68
  type Breakable,
@@ -78,6 +81,27 @@ import type { TreeCheckout } from "./treeCheckout.js";
78
81
  */
79
82
  export const ViewSlot = anchorSlot<TreeView<ImplicitFieldSchema>>();
80
83
 
84
+ function throwIfSchemaIsIncompatible(compatibility: SchemaCompatibilityStatusBeta): void {
85
+ if (compatibility.canView) {
86
+ return;
87
+ }
88
+
89
+ const resolution = compatibility.canInitialize
90
+ ? "The document is uninitialized; call TreeView.initialize() before reading or writing TreeView.root."
91
+ : compatibility.canUpgrade
92
+ ? "The stored schema can be upgraded; call TreeView.upgradeSchema() before reading or writing TreeView.root."
93
+ : "The schemas cannot be upgraded automatically. Use a compatible view schema or explicitly migrate the document schema and data.";
94
+ throw new UsageError(
95
+ `TreeView.root is unavailable because the view schema is incompatible with the stored schema. ${resolution}`,
96
+ tagSchemaArtifacts({
97
+ schemaIncompatibilityDetails:
98
+ compatibility.discrepancies === undefined
99
+ ? undefined
100
+ : JSON.stringify(compatibility.discrepancies),
101
+ }),
102
+ );
103
+ }
104
+
81
105
  /**
82
106
  * Implementation of TreeView wrapping a FlexTreeView.
83
107
  */
@@ -94,9 +118,14 @@ export class SchematizingSimpleTreeView<
94
118
  private flexTreeContext: Context | undefined;
95
119
 
96
120
  /**
97
- * Undefined iff uninitialized or disposed.
121
+ * Undefined if and only if uninitialized or disposed.
98
122
  */
99
- private currentCompatibility: SchemaCompatibilityStatus | undefined;
123
+ private currentCompatibility: SchemaCompatibilityStatusBeta | undefined;
124
+ /**
125
+ * Cached map of upgrade statuses, computed alongside compatibility.
126
+ * @remarks Undefined if and only if uninitialized or disposed.
127
+ */
128
+ private currentEnabledUpgrades: ReadonlyMap<SchemaUpgrade, StagedUpgradeStatus> | undefined;
100
129
  public readonly events: Listenable<TreeViewEvents & TreeBranchEvents> &
101
130
  IEmitter<TreeViewEvents & TreeBranchEvents> &
102
131
  HasListeners<TreeViewEvents & TreeBranchEvents> = createEmitter();
@@ -154,9 +183,7 @@ export class SchematizingSimpleTreeView<
154
183
  const stagedUpgradePolicy =
155
184
  config instanceof TreeViewConfigurationAlpha ? config.stagedUpgradePolicy : undefined;
156
185
  const configAlpha = new TreeViewConfigurationAlpha({
157
- schema: config.schema,
158
- enableSchemaValidation: config.enableSchemaValidation,
159
- preventAmbiguity: config.preventAmbiguity,
186
+ ...config,
160
187
  stagedUpgradePolicy,
161
188
  });
162
189
  this.stagedUpgradePolicy = configAlpha.stagedUpgradePolicy;
@@ -169,7 +196,9 @@ export class SchematizingSimpleTreeView<
169
196
  canUpgrade: true,
170
197
  isEquivalent: false,
171
198
  canInitialize: true,
199
+ discrepancies: undefined,
172
200
  };
201
+ this.currentEnabledUpgrades = new Map();
173
202
  this.update();
174
203
 
175
204
  this.unregisterCallbacks.add(
@@ -180,7 +209,11 @@ export class SchematizingSimpleTreeView<
180
209
  );
181
210
  }
182
211
 
183
- public isBranch(): this is TreeBranchAlpha {
212
+ public isBranch(): this is UntypedTreeViewAlpha {
213
+ return this.isView();
214
+ }
215
+
216
+ public isView(): this is UntypedTreeViewAlpha {
184
217
  return true;
185
218
  }
186
219
 
@@ -265,7 +298,7 @@ export class SchematizingSimpleTreeView<
265
298
  public upgradeSchema(): void {
266
299
  this.ensureUndisposed();
267
300
 
268
- const newSchema = toUpgradeSchema(this.viewSchema.root, this.stagedUpgradePolicy);
301
+ const newSchema = toUpgradeSchema(this.viewSchema.root, this.effectiveUpgradePolicy);
269
302
  const storedSchema = this.checkout.storedSchema.clone();
270
303
  if (!allowsRepoSuperset(defaultSchemaPolicy, storedSchema, newSchema)) {
271
304
  throw new UsageError(
@@ -280,6 +313,35 @@ export class SchematizingSimpleTreeView<
280
313
  this.runSchemaEdit(() => this.checkout.updateSchema(newSchema));
281
314
  }
282
315
 
316
+ public isStagedUpgradeEnabled(upgrade: SchemaUpgrade): StagedUpgradeStatus {
317
+ if (!this.currentEnabledUpgrades) {
318
+ this.failDisposed();
319
+ }
320
+ return this.currentEnabledUpgrades.get(upgrade) ?? "disabled";
321
+ }
322
+
323
+ private get effectiveUpgradePolicy(): StagedSchemaUpgradePolicy {
324
+ const configuredPolicy = this.stagedUpgradePolicy;
325
+ if (configuredPolicy.includeAlreadyEnabledUpgrades === false) {
326
+ return configuredPolicy;
327
+ }
328
+ const enabledUpgrades = this.currentEnabledUpgrades;
329
+ assert(
330
+ enabledUpgrades !== undefined,
331
+ 0xd3e /* Enabled upgrades must be available for an active view */,
332
+ );
333
+ if (enabledUpgrades.size === 0) {
334
+ return configuredPolicy;
335
+ }
336
+
337
+ return {
338
+ includeStaged: (upgrade) =>
339
+ configuredPolicy.includeStaged(upgrade) || enabledUpgrades.has(upgrade),
340
+ includeStagedOptional: (upgrade) =>
341
+ configuredPolicy.includeStagedOptional(upgrade) || enabledUpgrades.has(upgrade),
342
+ };
343
+ }
344
+
283
345
  /**
284
346
  * Gets the flex-tree context. Throws when disposed or out of schema.
285
347
  */
@@ -437,12 +499,16 @@ export class SchematizingSimpleTreeView<
437
499
  }
438
500
  }
439
501
 
440
- private computeCompatibility(): SchemaCompatibilityStatus {
441
- const compatibility = checkSchemaCompatibility(
502
+ /**
503
+ * Computes the current schema compatibility status and updates the cached enabled upgrades.
504
+ */
505
+ private computeCompatibility(): SchemaCompatibilityStatusBeta {
506
+ const { enabledUpgrades, ...compatibility } = checkSchemaCompatibility(
442
507
  this.viewSchema,
443
508
  this.checkout.storedSchema,
444
509
  this.stagedUpgradePolicy,
445
510
  );
511
+ this.currentEnabledUpgrades = enabledUpgrades;
446
512
  return {
447
513
  ...compatibility,
448
514
  canInitialize: canInitialize(this.checkout),
@@ -481,7 +547,7 @@ export class SchematizingSimpleTreeView<
481
547
  anchors.slots.delete(SimpleContextSlot);
482
548
  }
483
549
 
484
- public get compatibility(): SchemaCompatibilityStatus {
550
+ public get compatibility(): SchemaCompatibilityStatusBeta {
485
551
  if (!this.currentCompatibility) {
486
552
  this.failDisposed();
487
553
  }
@@ -496,6 +562,7 @@ export class SchematizingSimpleTreeView<
496
562
  }
497
563
  this.checkout.forest.anchors.slots.delete(ViewSlot);
498
564
  this.currentCompatibility = undefined;
565
+ this.currentEnabledUpgrades = undefined;
499
566
  this.onDispose?.();
500
567
  if (!this.checkout.isSharedBranch && !this.checkout.disposed) {
501
568
  // All non-shared branches are 1:1 with views, so if a user manually disposes a view, we should also dispose the checkout/branch.
@@ -505,11 +572,7 @@ export class SchematizingSimpleTreeView<
505
572
 
506
573
  private get flexRoot(): FlexTreeOptionalField | FlexTreeRequiredField {
507
574
  this.breaker.use();
508
- if (!this.compatibility.canView) {
509
- throw new UsageError(
510
- "Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.",
511
- );
512
- }
575
+ throwIfSchemaIsIncompatible(this.compatibility);
513
576
  const view = this.getFlexTreeContext();
514
577
  assert(
515
578
  view.root.is(FieldKinds.optional) ||
@@ -526,11 +589,7 @@ export class SchematizingSimpleTreeView<
526
589
 
527
590
  public set root(newRoot: InsertableField<TRootSchema>) {
528
591
  this.breaker.use();
529
- if (!this.compatibility.canView) {
530
- throw new UsageError(
531
- "Document is out of schema. Check TreeView.compatibility before accessing TreeView.root.",
532
- );
533
- }
592
+ throwIfSchemaIsIncompatible(this.compatibility);
534
593
  const view = this.getFlexTreeContext();
535
594
  setField(
536
595
  view.root,
@@ -542,28 +601,40 @@ export class SchematizingSimpleTreeView<
542
601
 
543
602
  // #region Branching
544
603
 
545
- public fork(): ReturnType<TreeBranchAlpha["fork"]> &
604
+ public fork(): ReturnType<UntypedTreeViewAlpha["fork"]> &
546
605
  SchematizingSimpleTreeView<TRootSchema> {
547
606
  return this.checkout.fork().viewWith(this.config);
548
607
  }
549
608
 
550
- public merge(context: TreeBranchAlpha, disposeMerged = true): void {
609
+ public rewindTo(revision: string): void {
610
+ this.checkout.rewindTo(revision);
611
+ }
612
+
613
+ public revertTo(revision: string, options?: RevertToOptionsAlpha): void {
614
+ this.checkout.revertTo(revision, options);
615
+ }
616
+
617
+ public merge(context: UntypedTreeViewAlpha, disposeMerged = true): void {
551
618
  this.checkout.merge(context, disposeMerged);
552
619
  }
553
620
 
554
- public rebaseOnto(context: TreeBranchAlpha): void {
621
+ public rebaseOnto(context: UntypedTreeViewAlpha): void {
555
622
  this.checkout.rebaseOnto(context);
556
623
  }
557
624
 
558
- public isMissingEditsFrom(context: TreeBranchAlpha): boolean {
625
+ public isMissingEditsFrom(context: UntypedTreeViewAlpha): boolean {
559
626
  return this.checkout.isMissingEditsFrom(context);
560
627
  }
561
628
 
562
629
  public computeNetChangeIfRebasedOnto(
563
- context: TreeBranchAlpha,
630
+ context: UntypedTreeViewAlpha,
564
631
  ): JsonCompatibleReadOnly | undefined {
565
632
  return this.checkout.computeNetChangeIfRebasedOnto(context);
566
633
  }
567
634
 
568
635
  // #endregion Branching
636
+
637
+ public get branchHistory(): TreeBranchHistory {
638
+ return this.checkout.branchHistory;
639
+ }
569
640
  }
@@ -524,6 +524,7 @@ export const changeFormatVersionForEditManager = DependentFormatVersion.fromPair
524
524
  [EditManagerFormatVersion.v4, SharedTreeChangeFormatVersion.v4],
525
525
  [EditManagerFormatVersion.vSharedBranches, SharedTreeChangeFormatVersion.v4],
526
526
  [EditManagerFormatVersion.v6, SharedTreeChangeFormatVersion.v5],
527
+ [EditManagerFormatVersion.v7, SharedTreeChangeFormatVersion.v5],
527
528
  ]);
528
529
 
529
530
  /**
@@ -540,6 +541,7 @@ export const changeFormatVersionForMessage = DependentFormatVersion.fromPairs<
540
541
  [MessageFormatVersion.v4, SharedTreeChangeFormatVersion.v4],
541
542
  [MessageFormatVersion.vSharedBranches, SharedTreeChangeFormatVersion.v4],
542
543
  [MessageFormatVersion.v6, SharedTreeChangeFormatVersion.v5],
544
+ [MessageFormatVersion.v7, SharedTreeChangeFormatVersion.v5],
543
545
  ]);
544
546
 
545
547
  function getCodecTreeForEditManagerFormat(
@@ -659,8 +661,9 @@ export interface SharedTreeOptions
659
661
  * @remarks
660
662
  * By default, SharedTree evicts trunk commits once all peers have acknowledged them (i.e. once they
661
663
  * are outside the collaboration window), and they are not otherwise retained (e.g. by revertibles or
662
- * local branches), to bound memory usage. Enabling this flag retains the full trunk history for the
663
- * lifetime of the client, which increases memory usage over time and should be used with care.
664
+ * local branches), to bound memory usage and document size.
665
+ * As long as this flag is enabled, trunk commits are retained - this increases memory usage and document size
666
+ * over time and should be used with care.
664
667
  */
665
668
  readonly retainHistory?: boolean;
666
669
 
@@ -58,7 +58,7 @@ export const Tree: Tree = {
58
58
  ...treeNodeApi,
59
59
 
60
60
  // Note: the implementation details of `createRunTransaction` are deprecated.
61
- // We have introduced replacement `@alpha` APIs on `TreeBranch`, but until they are `@public`, we can't reasonably deprecated this.
61
+ // We have introduced replacement `@alpha` APIs on `UntypedTreeView`, but until they are `@public`, we can't reasonably deprecated this.
62
62
  // Once they have been promoted to public, we can deprecate this API.
63
63
  runTransaction: createRunTransaction(),
64
64
 
@@ -58,7 +58,7 @@ import {
58
58
  type TreeEncodingOptions,
59
59
  type VerboseTree,
60
60
  extractPersistedSchema,
61
- type TreeBranch,
61
+ type UntypedTreeView,
62
62
  TreeViewConfigurationAlpha,
63
63
  getStoredKey,
64
64
  getPropertyKeyFromStoredKey,
@@ -84,7 +84,6 @@ import {
84
84
  type TreeContextAlpha,
85
85
  type TreeNodeSchema,
86
86
  getUnhydratedContext,
87
- type TreeBranchAlpha,
88
87
  } from "../simple-tree/index.js";
89
88
  import { brand, extractFromOpaque, type JsonCompatible } from "../util/index.js";
90
89
 
@@ -96,22 +95,22 @@ const identifier: TreeIdentifierUtils = (node: TreeNode): string | undefined =>
96
95
  return getIdentifierFromNode(node, "uncompressed");
97
96
  };
98
97
 
99
- identifier.shorten = (branch: TreeBranch, nodeIdentifier: string): number | undefined => {
98
+ identifier.shorten = (view: UntypedTreeView, nodeIdentifier: string): number | undefined => {
100
99
  assert(
101
- branch instanceof SchematizingSimpleTreeView,
100
+ view instanceof SchematizingSimpleTreeView,
102
101
  0xcac /* Unexpected branch implementation */,
103
102
  );
104
- const { nodeKeyManager } = branch;
103
+ const { nodeKeyManager } = view;
105
104
  const localNodeKey = nodeKeyManager.tryLocalizeNodeIdentifier(nodeIdentifier);
106
105
  return localNodeKey === undefined ? undefined : extractFromOpaque(localNodeKey);
107
106
  };
108
107
 
109
- identifier.lengthen = (branch: TreeBranch, nodeIdentifier: number): string => {
108
+ identifier.lengthen = (view: UntypedTreeView, nodeIdentifier: number): string => {
110
109
  assert(
111
- branch instanceof SchematizingSimpleTreeView,
110
+ view instanceof SchematizingSimpleTreeView,
112
111
  0xcad /* Unexpected branch implementation */,
113
112
  );
114
- const { nodeKeyManager } = branch;
113
+ const { nodeKeyManager } = view;
115
114
  const local = brand<LocalNodeIdentifier>(nodeIdentifier as SessionSpaceCompressedId);
116
115
  return nodeKeyManager.stabilizeNodeIdentifier(local);
117
116
  };
@@ -121,8 +120,8 @@ identifier.getShort = (node: TreeNode): number | undefined => {
121
120
  return typeof shortIdentifier === "number" ? shortIdentifier : undefined;
122
121
  };
123
122
 
124
- identifier.create = (branch: TreeBranch): string => {
125
- const nodeKeyManager = (branch as SchematizingSimpleTreeView<ImplicitFieldSchema>)
123
+ identifier.create = (view: UntypedTreeView): string => {
124
+ const nodeKeyManager = (view as SchematizingSimpleTreeView<ImplicitFieldSchema>)
126
125
  .nodeKeyManager;
127
126
  return nodeKeyManager.stabilizeNodeIdentifier(nodeKeyManager.generateLocalNodeIdentifier());
128
127
  };
@@ -154,7 +153,7 @@ export interface TreeIdentifierUtils {
154
153
  (node: TreeNode): string | undefined;
155
154
 
156
155
  /**
157
- * Returns the shortened identifier as a number given a UUID known by the id compressor on the branch.
156
+ * Returns the shortened identifier as a number given a UUID known by the id compressor on the view.
158
157
  * @remarks
159
158
  * If the given string is not a valid identifier and/or was not generated by the SharedTree, this will return `undefined`.
160
159
  *
@@ -163,10 +162,10 @@ export interface TreeIdentifierUtils {
163
162
  * This method is the inverse of {@link TreeIdentifierUtils.lengthen}.
164
163
  * If you shorten an identifier and then immediately pass it to {@link TreeIdentifierUtils.lengthen}, you will get the original string back.
165
164
  *
166
- * @param branch - The branch (and/or view) of the SharedTree that will perform the compression.
165
+ * @param view - The view of the SharedTree that will perform the compression.
167
166
  * @param nodeIdentifier - the stable identifier to be shortened.
168
167
  */
169
- shorten(branch: TreeBranch, nodeIdentifier: string): number | undefined;
168
+ shorten(view: UntypedTreeView, nodeIdentifier: string): number | undefined;
170
169
 
171
170
  /**
172
171
  * Returns the stable id as a string if the identifier is decompressible and known by the id compressor.
@@ -176,10 +175,10 @@ export interface TreeIdentifierUtils {
176
175
  * This method is the inverse of {@link TreeIdentifierUtils.shorten}.
177
176
  * If you lengthen an identifier and then immediately pass it to {@link TreeIdentifierUtils.shorten}, you will get the original short identifier back.
178
177
  *
179
- * @param branch - The branch (and/or view) of the SharedTree that will perform the decompression.
178
+ * @param view - The view of the SharedTree that will perform the decompression.
180
179
  * @param nodeIdentifier - The local identifier to be lengthened.
181
180
  */
182
- lengthen(branch: TreeBranch, nodeIdentifier: number): string;
181
+ lengthen(view: UntypedTreeView, nodeIdentifier: number): string;
183
182
 
184
183
  /**
185
184
  * Returns the {@link TreeIdentifierUtils.shorten | shortened} form of the identifier {@link SchemaFactory.identifier | identifier} for the given node.
@@ -206,9 +205,9 @@ export interface TreeIdentifierUtils {
206
205
  * @remarks
207
206
  * The returned UUID string can be {@link TreeIdentifierUtils.shorten | shortened} for high-performance scenarios.
208
207
  *
209
- * @param branch - The branch (and/or view) of the SharedTree that will generate and manage the identifier.
208
+ * @param view - The view of the SharedTree that will generate and manage the identifier.
210
209
  */
211
- create(branch: TreeBranch): string;
210
+ create(view: UntypedTreeView): string;
212
211
  }
213
212
 
214
213
  /**
@@ -253,19 +252,6 @@ export interface TreeAlpha {
253
252
  listener: NoInfer<TreeChangeEventsAlpha<TNode>[K]>,
254
253
  ): () => void;
255
254
 
256
- /**
257
- * Retrieve the {@link TreeBranch | branch}, if any, for the given node.
258
- * @param node - The node to query
259
- * @remarks If the node has already been inserted into the tree, this will return the branch associated with that node's {@link TreeView | view}.
260
- * Otherwise, it will return `undefined` (because the node has not yet been inserted and is therefore not part of a branch or view).
261
- *
262
- * This does not fork a new branch, but rather retrieves the _existing_ branch for the node.
263
- * To create a new branch, use e.g. {@link TreeBranch.fork | `myBranch.fork()`}.
264
- *
265
- * @deprecated To obtain a {@link TreeBranchAlpha | branch }, use `TreeAlpha.context(node)` to obtain a {@link TreeContextAlpha | context} and then check {@link TreeContextAlpha.isBranch | isBranch()}.
266
- */
267
- branch(node: TreeNode): TreeBranchAlpha | undefined;
268
-
269
255
  /**
270
256
  * Retrieve the {@link TreeContextAlpha | context} for the given node.
271
257
  * @param node - The node to query
@@ -842,13 +828,9 @@ export const TreeAlpha: TreeAlpha = {
842
828
  },
843
829
 
844
830
  context(node: TreeNode): TreeContextAlpha {
845
- return this.branch(node) ?? UnhydratedTreeContext.instance;
846
- },
847
-
848
- branch(node: TreeNode): TreeBranchAlpha | undefined {
849
831
  const kernel = getKernel(node);
850
832
  if (!kernel.isHydrated()) {
851
- return undefined;
833
+ return UnhydratedTreeContext.instance;
852
834
  }
853
835
  const view = kernel.anchorNode.anchorSet.slots.get(ViewSlot);
854
836
  assert(