@fluidframework/tree 2.92.0 → 2.93.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 (292) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +1 -1
  3. package/api-report/tree.alpha.api.md +57 -29
  4. package/api-report/tree.beta.api.md +41 -12
  5. package/api-report/tree.legacy.beta.api.md +41 -12
  6. package/dist/api.d.ts +6 -1
  7. package/dist/api.d.ts.map +1 -1
  8. package/dist/api.js.map +1 -1
  9. package/dist/core/tree/anchorSet.d.ts.map +1 -1
  10. package/dist/core/tree/anchorSet.js +21 -0
  11. package/dist/core/tree/anchorSet.js.map +1 -1
  12. package/dist/entrypoints/alpha.d.ts +1 -1
  13. package/dist/entrypoints/alpha.d.ts.map +1 -1
  14. package/dist/entrypoints/alpha.js +4 -4
  15. package/dist/entrypoints/alpha.js.map +1 -1
  16. package/dist/entrypoints/beta.d.ts +1 -1
  17. package/dist/entrypoints/beta.d.ts.map +1 -1
  18. package/dist/entrypoints/beta.js +3 -1
  19. package/dist/entrypoints/beta.js.map +1 -1
  20. package/dist/entrypoints/legacy.d.ts +1 -1
  21. package/dist/entrypoints/legacy.d.ts.map +1 -1
  22. package/dist/entrypoints/legacy.js +3 -1
  23. package/dist/entrypoints/legacy.js.map +1 -1
  24. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  25. package/dist/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  26. package/dist/feature-libraries/chunked-forest/chunkTree.js +2 -1
  27. package/dist/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  28. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  29. package/dist/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  30. package/dist/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  31. package/dist/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  32. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts +1 -0
  33. package/dist/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  34. package/dist/feature-libraries/indexing/anchorTreeIndex.js +3 -1
  35. package/dist/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  36. package/dist/feature-libraries/indexing/types.d.ts +4 -3
  37. package/dist/feature-libraries/indexing/types.d.ts.map +1 -1
  38. package/dist/feature-libraries/indexing/types.js.map +1 -1
  39. package/dist/index.d.ts +1 -1
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/packageVersion.d.ts +1 -1
  43. package/dist/packageVersion.js +1 -1
  44. package/dist/packageVersion.js.map +1 -1
  45. package/dist/serializableDomainSchema.d.ts +5 -5
  46. package/dist/serializableDomainSchema.d.ts.map +1 -1
  47. package/dist/serializableDomainSchema.js.map +1 -1
  48. package/dist/shared-tree/treeAlpha.d.ts +6 -2
  49. package/dist/shared-tree/treeAlpha.d.ts.map +1 -1
  50. package/dist/shared-tree/treeAlpha.js.map +1 -1
  51. package/dist/simple-tree/api/discrepancies.js +4 -1
  52. package/dist/simple-tree/api/discrepancies.js.map +1 -1
  53. package/dist/simple-tree/api/identifierIndex.d.ts +2 -2
  54. package/dist/simple-tree/api/identifierIndex.js +1 -1
  55. package/dist/simple-tree/api/identifierIndex.js.map +1 -1
  56. package/dist/simple-tree/api/index.d.ts +2 -2
  57. package/dist/simple-tree/api/index.d.ts.map +1 -1
  58. package/dist/simple-tree/api/index.js +3 -2
  59. package/dist/simple-tree/api/index.js.map +1 -1
  60. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts +31 -2
  61. package/dist/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  62. package/dist/simple-tree/api/schemaFactoryAlpha.js +17 -1
  63. package/dist/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  64. package/dist/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  65. package/dist/simple-tree/api/simpleTreeIndex.js +1 -1
  66. package/dist/simple-tree/api/simpleTreeIndex.js.map +1 -1
  67. package/dist/simple-tree/api/storedSchema.d.ts.map +1 -1
  68. package/dist/simple-tree/api/storedSchema.js +4 -1
  69. package/dist/simple-tree/api/storedSchema.js.map +1 -1
  70. package/dist/simple-tree/api/treeAlpha.d.ts +70 -13
  71. package/dist/simple-tree/api/treeAlpha.d.ts.map +1 -1
  72. package/dist/simple-tree/api/treeAlpha.js.map +1 -1
  73. package/dist/simple-tree/api/treeChangeEvents.d.ts +1 -1
  74. package/dist/simple-tree/api/treeChangeEvents.js.map +1 -1
  75. package/dist/simple-tree/api/treeNodeApi.d.ts +60 -1
  76. package/dist/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  77. package/dist/simple-tree/api/treeNodeApi.js +68 -6
  78. package/dist/simple-tree/api/treeNodeApi.js.map +1 -1
  79. package/dist/simple-tree/core/toStored.d.ts +7 -0
  80. package/dist/simple-tree/core/toStored.d.ts.map +1 -1
  81. package/dist/simple-tree/core/toStored.js.map +1 -1
  82. package/dist/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  83. package/dist/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  84. package/dist/simple-tree/core/unhydratedFlexTree.js +114 -12
  85. package/dist/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  86. package/dist/simple-tree/fieldSchema.d.ts +6 -1
  87. package/dist/simple-tree/fieldSchema.d.ts.map +1 -1
  88. package/dist/simple-tree/fieldSchema.js +3 -0
  89. package/dist/simple-tree/fieldSchema.js.map +1 -1
  90. package/dist/simple-tree/index.d.ts +2 -2
  91. package/dist/simple-tree/index.d.ts.map +1 -1
  92. package/dist/simple-tree/index.js +4 -3
  93. package/dist/simple-tree/index.js.map +1 -1
  94. package/dist/simple-tree/node-kinds/index.d.ts +1 -1
  95. package/dist/simple-tree/node-kinds/index.d.ts.map +1 -1
  96. package/dist/simple-tree/node-kinds/index.js.map +1 -1
  97. package/dist/simple-tree/node-kinds/map/index.d.ts +1 -1
  98. package/dist/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  99. package/dist/simple-tree/node-kinds/map/index.js.map +1 -1
  100. package/dist/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  101. package/dist/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  102. package/dist/simple-tree/node-kinds/map/mapNode.js +6 -1
  103. package/dist/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  104. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  105. package/dist/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  106. package/dist/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  107. package/dist/simple-tree/simpleSchema.d.ts +17 -0
  108. package/dist/simple-tree/simpleSchema.d.ts.map +1 -1
  109. package/dist/simple-tree/simpleSchema.js.map +1 -1
  110. package/dist/simple-tree/toStoredSchema.d.ts.map +1 -1
  111. package/dist/simple-tree/toStoredSchema.js +23 -1
  112. package/dist/simple-tree/toStoredSchema.js.map +1 -1
  113. package/dist/tableSchema.d.ts +4 -5
  114. package/dist/tableSchema.d.ts.map +1 -1
  115. package/dist/tableSchema.js +12 -23
  116. package/dist/tableSchema.js.map +1 -1
  117. package/dist/text/textDomain.d.ts.map +1 -1
  118. package/dist/text/textDomain.js +27 -0
  119. package/dist/text/textDomain.js.map +1 -1
  120. package/dist/text/textDomainFormatted.d.ts +4 -4
  121. package/dist/util/index.d.ts +1 -1
  122. package/dist/util/index.d.ts.map +1 -1
  123. package/dist/util/index.js +2 -3
  124. package/dist/util/index.js.map +1 -1
  125. package/dist/util/utils.d.ts +0 -1
  126. package/dist/util/utils.d.ts.map +1 -1
  127. package/dist/util/utils.js +1 -6
  128. package/dist/util/utils.js.map +1 -1
  129. package/eslint.config.mts +1 -1
  130. package/lib/api.d.ts +6 -1
  131. package/lib/api.d.ts.map +1 -1
  132. package/lib/api.js.map +1 -1
  133. package/lib/core/tree/anchorSet.d.ts.map +1 -1
  134. package/lib/core/tree/anchorSet.js +21 -0
  135. package/lib/core/tree/anchorSet.js.map +1 -1
  136. package/lib/entrypoints/alpha.d.ts +1 -1
  137. package/lib/entrypoints/alpha.d.ts.map +1 -1
  138. package/lib/entrypoints/alpha.js +1 -1
  139. package/lib/entrypoints/alpha.js.map +1 -1
  140. package/lib/entrypoints/beta.d.ts +1 -1
  141. package/lib/entrypoints/beta.d.ts.map +1 -1
  142. package/lib/entrypoints/beta.js +1 -1
  143. package/lib/entrypoints/beta.js.map +1 -1
  144. package/lib/entrypoints/legacy.d.ts +1 -1
  145. package/lib/entrypoints/legacy.d.ts.map +1 -1
  146. package/lib/entrypoints/legacy.js +1 -1
  147. package/lib/entrypoints/legacy.js.map +1 -1
  148. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts +2 -2
  149. package/lib/feature-libraries/chunked-forest/chunkTree.d.ts.map +1 -1
  150. package/lib/feature-libraries/chunked-forest/chunkTree.js +2 -1
  151. package/lib/feature-libraries/chunked-forest/chunkTree.js.map +1 -1
  152. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts +13 -5
  153. package/lib/feature-libraries/chunked-forest/uniformChunk.d.ts.map +1 -1
  154. package/lib/feature-libraries/chunked-forest/uniformChunk.js +22 -18
  155. package/lib/feature-libraries/chunked-forest/uniformChunk.js.map +1 -1
  156. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts +1 -0
  157. package/lib/feature-libraries/indexing/anchorTreeIndex.d.ts.map +1 -1
  158. package/lib/feature-libraries/indexing/anchorTreeIndex.js +3 -1
  159. package/lib/feature-libraries/indexing/anchorTreeIndex.js.map +1 -1
  160. package/lib/feature-libraries/indexing/types.d.ts +4 -3
  161. package/lib/feature-libraries/indexing/types.d.ts.map +1 -1
  162. package/lib/feature-libraries/indexing/types.js.map +1 -1
  163. package/lib/index.d.ts +1 -1
  164. package/lib/index.d.ts.map +1 -1
  165. package/lib/index.js.map +1 -1
  166. package/lib/packageVersion.d.ts +1 -1
  167. package/lib/packageVersion.js +1 -1
  168. package/lib/packageVersion.js.map +1 -1
  169. package/lib/serializableDomainSchema.d.ts +5 -5
  170. package/lib/serializableDomainSchema.d.ts.map +1 -1
  171. package/lib/serializableDomainSchema.js +4 -1
  172. package/lib/serializableDomainSchema.js.map +1 -1
  173. package/lib/shared-tree/treeAlpha.d.ts +6 -2
  174. package/lib/shared-tree/treeAlpha.d.ts.map +1 -1
  175. package/lib/shared-tree/treeAlpha.js.map +1 -1
  176. package/lib/simple-tree/api/discrepancies.js +4 -1
  177. package/lib/simple-tree/api/discrepancies.js.map +1 -1
  178. package/lib/simple-tree/api/identifierIndex.d.ts +2 -2
  179. package/lib/simple-tree/api/identifierIndex.js +1 -1
  180. package/lib/simple-tree/api/identifierIndex.js.map +1 -1
  181. package/lib/simple-tree/api/index.d.ts +2 -2
  182. package/lib/simple-tree/api/index.d.ts.map +1 -1
  183. package/lib/simple-tree/api/index.js +1 -1
  184. package/lib/simple-tree/api/index.js.map +1 -1
  185. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts +31 -2
  186. package/lib/simple-tree/api/schemaFactoryAlpha.d.ts.map +1 -1
  187. package/lib/simple-tree/api/schemaFactoryAlpha.js +19 -3
  188. package/lib/simple-tree/api/schemaFactoryAlpha.js.map +1 -1
  189. package/lib/simple-tree/api/simpleTreeIndex.d.ts +5 -5
  190. package/lib/simple-tree/api/simpleTreeIndex.js +1 -1
  191. package/lib/simple-tree/api/simpleTreeIndex.js.map +1 -1
  192. package/lib/simple-tree/api/storedSchema.d.ts.map +1 -1
  193. package/lib/simple-tree/api/storedSchema.js +4 -1
  194. package/lib/simple-tree/api/storedSchema.js.map +1 -1
  195. package/lib/simple-tree/api/treeAlpha.d.ts +70 -13
  196. package/lib/simple-tree/api/treeAlpha.d.ts.map +1 -1
  197. package/lib/simple-tree/api/treeAlpha.js.map +1 -1
  198. package/lib/simple-tree/api/treeChangeEvents.d.ts +1 -1
  199. package/lib/simple-tree/api/treeChangeEvents.js.map +1 -1
  200. package/lib/simple-tree/api/treeNodeApi.d.ts +60 -1
  201. package/lib/simple-tree/api/treeNodeApi.d.ts.map +1 -1
  202. package/lib/simple-tree/api/treeNodeApi.js +66 -6
  203. package/lib/simple-tree/api/treeNodeApi.js.map +1 -1
  204. package/lib/simple-tree/core/toStored.d.ts +7 -0
  205. package/lib/simple-tree/core/toStored.d.ts.map +1 -1
  206. package/lib/simple-tree/core/toStored.js.map +1 -1
  207. package/lib/simple-tree/core/unhydratedFlexTree.d.ts +17 -3
  208. package/lib/simple-tree/core/unhydratedFlexTree.d.ts.map +1 -1
  209. package/lib/simple-tree/core/unhydratedFlexTree.js +115 -13
  210. package/lib/simple-tree/core/unhydratedFlexTree.js.map +1 -1
  211. package/lib/simple-tree/fieldSchema.d.ts +6 -1
  212. package/lib/simple-tree/fieldSchema.d.ts.map +1 -1
  213. package/lib/simple-tree/fieldSchema.js +3 -0
  214. package/lib/simple-tree/fieldSchema.js.map +1 -1
  215. package/lib/simple-tree/index.d.ts +2 -2
  216. package/lib/simple-tree/index.d.ts.map +1 -1
  217. package/lib/simple-tree/index.js +1 -1
  218. package/lib/simple-tree/index.js.map +1 -1
  219. package/lib/simple-tree/node-kinds/index.d.ts +1 -1
  220. package/lib/simple-tree/node-kinds/index.d.ts.map +1 -1
  221. package/lib/simple-tree/node-kinds/index.js.map +1 -1
  222. package/lib/simple-tree/node-kinds/map/index.d.ts +1 -1
  223. package/lib/simple-tree/node-kinds/map/index.d.ts.map +1 -1
  224. package/lib/simple-tree/node-kinds/map/index.js.map +1 -1
  225. package/lib/simple-tree/node-kinds/map/mapNode.d.ts +13 -0
  226. package/lib/simple-tree/node-kinds/map/mapNode.d.ts.map +1 -1
  227. package/lib/simple-tree/node-kinds/map/mapNode.js +6 -1
  228. package/lib/simple-tree/node-kinds/map/mapNode.js.map +1 -1
  229. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts +6 -6
  230. package/lib/simple-tree/node-kinds/map/mapNodeTypes.d.ts.map +1 -1
  231. package/lib/simple-tree/node-kinds/map/mapNodeTypes.js.map +1 -1
  232. package/lib/simple-tree/simpleSchema.d.ts +17 -0
  233. package/lib/simple-tree/simpleSchema.d.ts.map +1 -1
  234. package/lib/simple-tree/simpleSchema.js.map +1 -1
  235. package/lib/simple-tree/toStoredSchema.d.ts.map +1 -1
  236. package/lib/simple-tree/toStoredSchema.js +24 -2
  237. package/lib/simple-tree/toStoredSchema.js.map +1 -1
  238. package/lib/tableSchema.d.ts +4 -5
  239. package/lib/tableSchema.d.ts.map +1 -1
  240. package/lib/tableSchema.js +12 -23
  241. package/lib/tableSchema.js.map +1 -1
  242. package/lib/text/textDomain.d.ts.map +1 -1
  243. package/lib/text/textDomain.js +29 -0
  244. package/lib/text/textDomain.js.map +1 -1
  245. package/lib/text/textDomainFormatted.d.ts +4 -4
  246. package/lib/tsdoc-metadata.json +1 -1
  247. package/lib/util/index.d.ts +1 -1
  248. package/lib/util/index.d.ts.map +1 -1
  249. package/lib/util/index.js +1 -1
  250. package/lib/util/index.js.map +1 -1
  251. package/lib/util/utils.d.ts +0 -1
  252. package/lib/util/utils.d.ts.map +1 -1
  253. package/lib/util/utils.js +0 -1
  254. package/lib/util/utils.js.map +1 -1
  255. package/package.json +30 -35
  256. package/src/api.ts +10 -0
  257. package/src/core/tree/anchorSet.ts +25 -0
  258. package/src/entrypoints/alpha.ts +20 -16
  259. package/src/entrypoints/beta.ts +7 -1
  260. package/src/entrypoints/legacy.ts +8 -10
  261. package/src/feature-libraries/chunked-forest/chunkTree.ts +3 -2
  262. package/src/feature-libraries/chunked-forest/uniformChunk.ts +42 -20
  263. package/src/feature-libraries/indexing/anchorTreeIndex.ts +1 -0
  264. package/src/feature-libraries/indexing/types.ts +5 -3
  265. package/src/index.ts +4 -0
  266. package/src/packageVersion.ts +1 -1
  267. package/src/serializableDomainSchema.ts +6 -0
  268. package/src/shared-tree/treeAlpha.ts +6 -2
  269. package/src/simple-tree/api/discrepancies.ts +6 -1
  270. package/src/simple-tree/api/identifierIndex.ts +2 -2
  271. package/src/simple-tree/api/index.ts +4 -0
  272. package/src/simple-tree/api/schemaFactoryAlpha.ts +67 -2
  273. package/src/simple-tree/api/simpleTreeIndex.ts +6 -6
  274. package/src/simple-tree/api/storedSchema.ts +4 -1
  275. package/src/simple-tree/api/treeAlpha.ts +75 -12
  276. package/src/simple-tree/api/treeChangeEvents.ts +1 -1
  277. package/src/simple-tree/api/treeNodeApi.ts +101 -7
  278. package/src/simple-tree/core/toStored.ts +8 -0
  279. package/src/simple-tree/core/unhydratedFlexTree.ts +134 -10
  280. package/src/simple-tree/fieldSchema.ts +10 -0
  281. package/src/simple-tree/index.ts +5 -0
  282. package/src/simple-tree/node-kinds/index.ts +1 -0
  283. package/src/simple-tree/node-kinds/map/index.ts +1 -0
  284. package/src/simple-tree/node-kinds/map/mapNode.ts +20 -3
  285. package/src/simple-tree/node-kinds/map/mapNodeTypes.ts +6 -6
  286. package/src/simple-tree/simpleSchema.ts +20 -0
  287. package/src/simple-tree/toStoredSchema.ts +28 -1
  288. package/src/tableSchema.ts +16 -28
  289. package/src/text/textDomain.ts +68 -1
  290. package/src/util/index.ts +0 -1
  291. package/src/util/utils.ts +0 -2
  292. package/.mocharc.customBenchmarks.cjs +0 -25
@@ -102,10 +102,6 @@ export {
102
102
  AnnotatedAllowedTypeUnsafe,
103
103
  AnnotatedAllowedTypes,
104
104
  AnnotatedAllowedTypesUnsafe,
105
- ArrayNodeDeltaOp,
106
- ArrayNodeInsertOp,
107
- ArrayNodeRemoveOp,
108
- ArrayNodeRetainOp,
109
105
  CodecWriteOptionsBeta,
110
106
  ConciseTree,
111
107
  ExtensibleUnionNode,
@@ -116,13 +112,11 @@ export {
116
112
  ForestTypeExpensiveDebug,
117
113
  ForestTypeOptimized,
118
114
  ForestTypeReference,
115
+ IdentifierIndex,
119
116
  JsonCompatible,
120
117
  JsonCompatibleObject,
121
118
  KeyEncodingOptions,
122
- NodeChangedData,
123
- NodeChangedDataAlpha,
124
- NodeChangedDataDelta,
125
- NodeChangedDataProperties,
119
+ NodeChangedData,
126
120
  ObjectSchemaOptions,
127
121
  PopUnion,
128
122
  RecordNodeInsertableData,
@@ -136,9 +130,11 @@ export {
136
130
  TableSchema,
137
131
  TreeBeta,
138
132
  TreeBranch,
139
- TreeChangeEventsBeta,
140
- TreeChangeEventsAlpha,
133
+ TreeChangeEventsBeta,
141
134
  TreeEncodingOptions,
135
+ TreeIndex,
136
+ TreeIndexKey,
137
+ TreeIndexNodes,
142
138
  TreeRecordNode,
143
139
  TreeRecordNodeUnsafe,
144
140
  TreeViewBeta,
@@ -149,7 +145,9 @@ export {
149
145
  adaptEnum,
150
146
  asBeta,
151
147
  configuredSharedTreeBeta,
148
+ createIdentifierIndex,
152
149
  createIndependentTreeBeta,
150
+ createTreeIndex,
153
151
  enumFromStrings,
154
152
  singletonSchema,
155
153
  snapshotSchemaCompatibility,
@@ -160,8 +158,14 @@ export {
160
158
  ArrayNodeCustomizableSchema,
161
159
  ArrayNodeCustomizableSchemaAlpha,
162
160
  ArrayNodeCustomizableSchemaUnsafe,
161
+ ArrayNodeDeltaOp,
162
+ ArrayNodeInsertOp,
163
163
  ArrayNodePojoEmulationSchema,
164
+ ArrayNodeRemoveOp,
165
+ ArrayNodeRetainOp,
164
166
  ArrayNodeSchema,
167
+ ArrayNodeTreeChangedDeltaOp,
168
+ ArrayNodeTreeChangedRetainOp,
165
169
  ArrayPlaceAnchor,
166
170
  ChangeMetadata,
167
171
  CodecName,
@@ -187,7 +191,6 @@ export {
187
191
  HandleConverter,
188
192
  ICodecOptions,
189
193
  ITreeAlpha,
190
- IdentifierIndex,
191
194
  IncrementalEncodingPolicy,
192
195
  IndependentViewOptions,
193
196
  Insertable,
@@ -220,6 +223,10 @@ export {
220
223
  MapNodePojoEmulationSchema,
221
224
  MapNodeSchema,
222
225
  NoChangeConstraint,
226
+ NodeChangedDataAlpha,
227
+ NodeChangedDataDelta,
228
+ NodeChangedDataProperties,
229
+ NodeChangedDataTreeDelta,
223
230
  NodeProvider,
224
231
  NodeSchemaOptionsAlpha,
225
232
  ObjectNodeSchema,
@@ -263,12 +270,11 @@ export {
263
270
  TreeArrayNodeAlpha,
264
271
  TreeBranchAlpha,
265
272
  TreeBranchEvents,
273
+ TreeChangeEventsAlpha,
266
274
  TreeCompressionStrategy,
267
275
  TreeContextAlpha,
268
276
  TreeIdentifierUtils,
269
- TreeIndex,
270
- TreeIndexKey,
271
- TreeIndexNodes,
277
+ TreeMapNodeAlpha,
272
278
  TreeParsingOptions,
273
279
  TreeSchema,
274
280
  TreeSchemaEncodingOptions,
@@ -290,9 +296,7 @@ export {
290
296
  configuredSharedTreeAlpha,
291
297
  contentSchemaSymbol,
292
298
  createArrayInsertionAnchor,
293
- createIdentifierIndex,
294
299
  createIndependentTreeAlpha,
295
- createTreeIndex,
296
300
  decodeSchemaCompatibilitySnapshot,
297
301
  encodeSchemaCompatibilitySnapshot,
298
302
  eraseSchemaDetails,
@@ -112,10 +112,11 @@ export {
112
112
  ForestTypeExpensiveDebug,
113
113
  ForestTypeOptimized,
114
114
  ForestTypeReference,
115
+ IdentifierIndex,
115
116
  JsonCompatible,
116
117
  JsonCompatibleObject,
117
118
  KeyEncodingOptions,
118
- NodeChangedData,
119
+ NodeChangedData,
119
120
  ObjectSchemaOptions,
120
121
  PopUnion,
121
122
  RecordNodeInsertableData,
@@ -131,6 +132,9 @@ export {
131
132
  TreeBranch,
132
133
  TreeChangeEventsBeta,
133
134
  TreeEncodingOptions,
135
+ TreeIndex,
136
+ TreeIndexKey,
137
+ TreeIndexNodes,
134
138
  TreeRecordNode,
135
139
  TreeRecordNodeUnsafe,
136
140
  TreeViewBeta,
@@ -141,7 +145,9 @@ export {
141
145
  adaptEnum,
142
146
  asBeta,
143
147
  configuredSharedTreeBeta,
148
+ createIdentifierIndex,
144
149
  createIndependentTreeBeta,
150
+ createTreeIndex,
145
151
  enumFromStrings,
146
152
  singletonSchema,
147
153
  snapshotSchemaCompatibility
@@ -102,10 +102,6 @@ export {
102
102
  AnnotatedAllowedTypeUnsafe,
103
103
  AnnotatedAllowedTypes,
104
104
  AnnotatedAllowedTypesUnsafe,
105
- ArrayNodeDeltaOp,
106
- ArrayNodeInsertOp,
107
- ArrayNodeRemoveOp,
108
- ArrayNodeRetainOp,
109
105
  CodecWriteOptionsBeta,
110
106
  ConciseTree,
111
107
  ExtensibleUnionNode,
@@ -116,13 +112,11 @@ export {
116
112
  ForestTypeExpensiveDebug,
117
113
  ForestTypeOptimized,
118
114
  ForestTypeReference,
115
+ IdentifierIndex,
119
116
  JsonCompatible,
120
117
  JsonCompatibleObject,
121
118
  KeyEncodingOptions,
122
- NodeChangedData,
123
- NodeChangedDataAlpha,
124
- NodeChangedDataDelta,
125
- NodeChangedDataProperties,
119
+ NodeChangedData,
126
120
  ObjectSchemaOptions,
127
121
  PopUnion,
128
122
  RecordNodeInsertableData,
@@ -136,9 +130,11 @@ export {
136
130
  TableSchema,
137
131
  TreeBeta,
138
132
  TreeBranch,
139
- TreeChangeEventsBeta,
140
- TreeChangeEventsAlpha,
133
+ TreeChangeEventsBeta,
141
134
  TreeEncodingOptions,
135
+ TreeIndex,
136
+ TreeIndexKey,
137
+ TreeIndexNodes,
142
138
  TreeRecordNode,
143
139
  TreeRecordNodeUnsafe,
144
140
  TreeViewBeta,
@@ -149,7 +145,9 @@ export {
149
145
  adaptEnum,
150
146
  asBeta,
151
147
  configuredSharedTreeBeta,
148
+ createIdentifierIndex,
152
149
  createIndependentTreeBeta,
150
+ createTreeIndex,
153
151
  enumFromStrings,
154
152
  singletonSchema,
155
153
  snapshotSchemaCompatibility,
@@ -424,8 +424,8 @@ export interface ChunkCompressor {
424
424
  /**
425
425
  * If the idCompressor is provided, {@link UniformChunk}s with identifiers will be encoded for its in-memory representation.
426
426
  * @remarks
427
- * This compression applies to {@link UniformChunk}s when {@link TreeShape.maybeDecompressedStringAsNumber} is set.
428
- * If the `policy` does not use UniformChunks or does not set `maybeDecompressedStringAsNumber`, then no compression will be applied even when providing `idCompressor`.
427
+ * This compression applies to {@link UniformChunk}s when {@link TreeShape.mayContainCompressedIds} is set.
428
+ * If the `policy` does not use UniformChunks or does not set `mayContainCompressedIds`, then no compression will be applied even when providing `idCompressor`.
429
429
  */
430
430
  readonly idCompressor: IIdCompressor | undefined;
431
431
  }
@@ -583,6 +583,7 @@ export function insertValues(
583
583
  // Slow path: walk shape and cursor together, inserting values.
584
584
  if (shape.hasValue) {
585
585
  if (
586
+ shape.mayContainCompressedIds &&
586
587
  typeof cursor.value === "string" &&
587
588
  idCompressor !== undefined &&
588
589
  isStableNodeIdentifier(cursor.value)
@@ -5,7 +5,6 @@
5
5
 
6
6
  import { assert, compareArrays, oob, fail } from "@fluidframework/core-utils/internal";
7
7
  import type { SessionSpaceCompressedId, IIdCompressor } from "@fluidframework/id-compressor";
8
- import { UsageError } from "@fluidframework/telemetry-utils/internal";
9
8
 
10
9
  import {
11
10
  CursorLocationType,
@@ -54,7 +53,7 @@ export class UniformChunk extends ReferenceCountedBase implements TreeChunk {
54
53
  idCompressor?: IIdCompressor,
55
54
  ) {
56
55
  super();
57
- this.idCompressor = idCompressor;
56
+ this.idCompressor = shape.treeShape.mayContainCompressedIds ? idCompressor : undefined;
58
57
  assert(
59
58
  shape.treeShape.valuesPerTopLevelNode * shape.topLevelLength === values.length,
60
59
  0x4c3 /* invalid number of values for shape */,
@@ -100,30 +99,45 @@ export class TreeShape {
100
99
  // TODO: this is only needed at chunk roots. Optimize it base on that.
101
100
  public readonly positions: readonly NodePositionInfo[];
102
101
 
102
+ /**
103
+ * Whether chunks using this shape (including any descendant leaf within it) may contain values compressed by the {@link UniformChunk.idCompressor}.
104
+ *
105
+ * @remarks
106
+ * For string leaf nodes, this can be explicitly set to `true` to indicate that the value may be a compressed id
107
+ * stored as a number that needs to be decompressed back to a string.
108
+ * For non-leaf nodes, this is automatically derived from whether any child shapes have it set.
109
+ */
110
+ public readonly mayContainCompressedIds: boolean;
111
+
103
112
  /**
104
113
  *
105
114
  * @param type - {@link TreeNodeSchemaIdentifier} used to compare shapes.
106
115
  * @param hasValue - whether or not the TreeShape has a value.
107
116
  * @param fieldsArray - an array of {@link FieldShape} values, which contains a TreeShape for each FieldKey.
108
117
  *
109
- * @param maybeDecompressedStringAsNumber - used to check whether or not the value could have been compressed by the idCompressor.
110
- * This flag can only be set on string leaf nodes, and will throw a usage error otherwise.
111
- * If set to true, an additional check can be made (example: getting the value of {@link Cursor}) to return the original uncompressed value.
118
+ * @param maybeCompressedIdLeaf - whether the value may have been compressed by the {@link UniformChunk.idCompressor}.
119
+ * Can only be explicitly set to `true` on string leaf nodes; otherwise this constructor asserts.
120
+ * For non-leaf nodes, {@link TreeShape.mayContainCompressedIds} is automatically derived from child shapes.
112
121
  */
113
122
  public constructor(
114
123
  public readonly type: TreeNodeSchemaIdentifier,
115
124
  public readonly hasValue: boolean,
116
125
  public readonly fieldsArray: readonly FieldShape[],
117
- public readonly maybeDecompressedStringAsNumber: boolean = false,
126
+ maybeCompressedIdLeaf: boolean = false,
118
127
  ) {
119
- if (
120
- maybeDecompressedStringAsNumber &&
121
- !(hasValue && type === "com.fluidframework.leaf.string")
122
- ) {
123
- throw new UsageError(
124
- "maybeDecompressedStringAsNumber flag can only be set to true for string leaf node.",
128
+ assert(
129
+ hasValue === false || fieldsArray.length === 0,
130
+ 0xcef /* only non-leaf can have fields */,
131
+ );
132
+ if (maybeCompressedIdLeaf) {
133
+ assert(
134
+ hasValue && type === "com.fluidframework.leaf.string",
135
+ 0xcf0 /* only strings can opt into maybeCompressedIdLeaf */,
125
136
  );
126
137
  }
138
+ // For non-leaf nodes, derive from whether any child shapes contain compressed ids.
139
+ this.mayContainCompressedIds =
140
+ maybeCompressedIdLeaf || fieldsArray.some(([, shape]) => shape.mayContainCompressedIds);
127
141
  const fields: Map<FieldKey, OffsetShape> = new Map();
128
142
  let numberOfValues = hasValue ? 1 : 0;
129
143
  const infos: NodePositionInfo[] = [
@@ -146,7 +160,7 @@ export class TreeShape {
146
160
  }
147
161
 
148
162
  public equals(other: TreeShape): boolean {
149
- // TODO: either dedup instances and/or store a collision resistant hash for fast compare.
163
+ // TODO: either dedupe instances and/or store a collision resistant hash for fast compare.
150
164
 
151
165
  if (
152
166
  !compareArrays(
@@ -157,7 +171,11 @@ export class TreeShape {
157
171
  ) {
158
172
  return false;
159
173
  }
160
- return this.type === other.type && this.hasValue === other.hasValue;
174
+ return (
175
+ this.type === other.type &&
176
+ this.hasValue === other.hasValue &&
177
+ this.mayContainCompressedIds === other.mayContainCompressedIds
178
+ );
161
179
  }
162
180
 
163
181
  public withTopLevelLength(topLevelLength: number): ChunkShape {
@@ -548,16 +566,20 @@ class Cursor extends SynchronousCursor implements ChunkedCursor {
548
566
  }
549
567
 
550
568
  public get value(): Value {
551
- const idCompressor = this.chunk.idCompressor;
552
569
  const info = this.nodeInfo(CursorLocationType.Nodes);
553
- // If the maybeDecompressedStringAsNumber flag is set to true, we check if the value is a number.
554
- // This flag can only ever be set on string leaf nodes, so if the value is a number, we can assume it is a compressible, known stable id.
555
- if (info.shape.hasValue && info.shape.maybeDecompressedStringAsNumber) {
570
+ if (info.shape.hasValue) {
556
571
  const value = this.chunk.values[info.valueOffset];
557
- if (typeof value === "number" && idCompressor !== undefined) {
572
+ // If mayContainCompressedIds is set, check if the value is a number (i.e. a compressed ID that needs decompression).
573
+ if (info.shape.mayContainCompressedIds && typeof value === "number") {
574
+ const idCompressor = this.chunk.idCompressor;
575
+ assert(
576
+ idCompressor !== undefined,
577
+ 0xcf1 /* chunk required idCompressor but did not provide it */,
578
+ );
558
579
  return idCompressor.decompress(value as SessionSpaceCompressedId);
559
580
  }
581
+ return value;
560
582
  }
561
- return info.shape.hasValue ? this.chunk.values[info.valueOffset] : undefined;
583
+ return undefined;
562
584
  }
563
585
  }
@@ -51,6 +51,7 @@ export type KeyFinder<TKey> = (tree: ITreeSubscriptionCursor) => TKey;
51
51
  * calling {@link keys} will not include any keys that are stored in the index but only map to detached nodes.
52
52
  */
53
53
  export class AnchorTreeIndex<TKey, TValue> implements TreeIndex<TKey, TValue> {
54
+ public readonly [Symbol.toStringTag] = "AnchorTreeIndex";
54
55
  public disposed = false;
55
56
  /**
56
57
  * Caches {@link KeyFinder}s for each schema definition. If a schema maps to null, it does not
@@ -3,10 +3,12 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ import type { FluidReadonlyMap } from "@fluidframework/core-interfaces/internal";
7
+
6
8
  /**
7
9
  * an array of nodes that is guaranteed to have at least one element
8
10
  *
9
- * @alpha
11
+ * @beta
10
12
  */
11
13
  export type TreeIndexNodes<TNode> = readonly [first: TNode, ...rest: TNode[]];
12
14
 
@@ -23,9 +25,9 @@ export type TreeIndexNodes<TNode> = readonly [first: TNode, ...rest: TNode[]];
23
25
  * Since currently partially loading a tree is not supported, there is no need for this.
24
26
  * At some point the low level shared tree index type for persisted indexes could be leveraged to provide user facing extensible sets of persisted indexes.
25
27
  * @sealed
26
- * @alpha
28
+ * @beta
27
29
  */
28
- export interface TreeIndex<TKey, TValue> extends ReadonlyMap<TKey, TValue> {
30
+ export interface TreeIndex<TKey, TValue> extends FluidReadonlyMap<TKey, TValue> {
29
31
  /**
30
32
  * Disposes the index such that it can no longer be used and receives no updates for changes in the tree.
31
33
  * @remarks
package/src/index.ts CHANGED
@@ -111,6 +111,7 @@ export {
111
111
  type TreeChangeEvents,
112
112
  type NodeFromSchema,
113
113
  type TreeMapNode,
114
+ type TreeMapNodeAlpha,
114
115
  type InsertableTreeNodeFromImplicitAllowedTypes,
115
116
  type TreeLeafValue,
116
117
  FieldKind,
@@ -136,10 +137,13 @@ export {
136
137
  type ArrayNodeInsertOp,
137
138
  type ArrayNodeRemoveOp,
138
139
  type ArrayNodeRetainOp,
140
+ type ArrayNodeTreeChangedDeltaOp,
141
+ type ArrayNodeTreeChangedRetainOp,
139
142
  type NodeChangedData,
140
143
  type NodeChangedDataAlpha,
141
144
  type NodeChangedDataDelta,
142
145
  type NodeChangedDataProperties,
146
+ type NodeChangedDataTreeDelta,
143
147
  type SchemaUpgrade,
144
148
  contentSchemaSymbol,
145
149
  // Types not really intended for public use, but used in links.
@@ -6,4 +6,4 @@
6
6
  */
7
7
 
8
8
  export const pkgName = "@fluidframework/tree";
9
- export const pkgVersion = "2.92.0";
9
+ export const pkgVersion = "2.93.0";
@@ -6,6 +6,12 @@
6
6
  import type { IFluidHandle } from "@fluidframework/core-interfaces";
7
7
 
8
8
  import {
9
+ // #region Unused imports to make d.ts cleaner
10
+ /* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */
11
+ NodeKind,
12
+ System_Unsafe,
13
+ /* eslint-enable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars */
14
+ // #endregion
9
15
  SchemaFactory,
10
16
  SchemaFactoryBeta,
11
17
  type FixRecursiveArraySchema,
@@ -240,8 +240,12 @@ export interface TreeAlpha {
240
240
  * @returns A callback function which will deregister the event.
241
241
  * This callback should be called only once.
242
242
  * @remarks
243
- * Provides a richer `nodeChanged` event than {@link (TreeBeta:interface).on} for array nodes the
244
- * event data includes a {@link NodeChangedDataDelta.delta | delta} payload.
243
+ * Provides richer events than {@link (TreeBeta:interface).on} for array nodes:
244
+ * - `nodeChanged` includes a {@link NodeChangedDataDelta.delta | delta} payload for direct
245
+ * changes (insert, remove, move).
246
+ * - `treeChanged` also includes a {@link NodeChangedDataDelta.delta | delta} payload and fires
247
+ * for both shallow changes and deep changes (e.g. a property of an element changed without
248
+ * any direct array change).
245
249
  */
246
250
  on<K extends keyof TreeChangeEventsAlpha<TNode>, TNode extends TreeNode>(
247
251
  node: TNode,
@@ -363,7 +363,12 @@ function* getFieldDiscrepancies(
363
363
  fail(0xbef /* A conversion from a FieldKind to a FlexFieldKind should exist */);
364
364
 
365
365
  // This checks if the field kind in the view schema is not compatible with the stored schema.
366
- if (viewKind.identifier !== stored.kind) {
366
+ // A staged optional field (optional in the view) is compatible with a required stored field
367
+ // during the rollout period — suppress the kind discrepancy in that case.
368
+ if (
369
+ viewKind.identifier !== stored.kind &&
370
+ !(view.isStagedOptional !== false && stored.kind === FieldKinds.required.identifier)
371
+ ) {
367
372
  yield {
368
373
  identifier,
369
374
  fieldKey,
@@ -17,7 +17,7 @@ import type { TreeView } from "./tree.js";
17
17
  /**
18
18
  * An index that returns tree nodes given their associated identifiers.
19
19
  *
20
- * @alpha
20
+ * @beta
21
21
  */
22
22
  export type IdentifierIndex = TreeIndex<string, TreeNode>;
23
23
 
@@ -28,7 +28,7 @@ function isStringKey(key: TreeIndexKey): key is string {
28
28
  /**
29
29
  * Creates an {@link IdentifierIndex} for a given {@link TreeView}.
30
30
  *
31
- * @alpha
31
+ * @beta
32
32
  */
33
33
  export function createIdentifierIndex<TSchema extends ImplicitFieldSchema>(
34
34
  view: TreeView<TSchema>,
@@ -66,6 +66,7 @@ export {
66
66
  createCustomizedFluidFrameworkScopedFactory,
67
67
  } from "./schemaCreationUtilities.js";
68
68
  export {
69
+ deltaMarksToArrayOps,
69
70
  getIdentifierFromNode,
70
71
  getPropertyKeyFromStoredKey,
71
72
  getStoredKey,
@@ -158,9 +159,12 @@ export {
158
159
  type ArrayNodeInsertOp,
159
160
  type ArrayNodeRemoveOp,
160
161
  type ArrayNodeRetainOp,
162
+ type ArrayNodeTreeChangedDeltaOp,
163
+ type ArrayNodeTreeChangedRetainOp,
161
164
  type NodeChangedDataAlpha,
162
165
  type NodeChangedDataDelta,
163
166
  type NodeChangedDataProperties,
167
+ type NodeChangedDataTreeDelta,
164
168
  type TreeChangeEventsAlpha,
165
169
  } from "./treeAlpha.js";
166
170
  export { createTreeIndex, type TreeIndexKey } from "./simpleTreeIndex.js";
@@ -11,6 +11,7 @@ import {
11
11
  type WithType,
12
12
  normalizeAllowedTypes,
13
13
  isTreeNode,
14
+ createSchemaUpgrade,
14
15
  } from "../core/index.js";
15
16
  // These imports prevent a large number of type references in the API reports from showing up as *_2.
16
17
  /* eslint-disable unused-imports/no-unused-imports, @typescript-eslint/no-unused-vars, import-x/no-duplicates */
@@ -18,7 +19,7 @@ import {
18
19
  type FieldProps,
19
20
  type FieldSchemaAlpha,
20
21
  type FieldPropsAlpha,
21
- type FieldKind,
22
+ FieldKind,
22
23
  type ImplicitFieldSchema,
23
24
  type InsertableTreeFieldFromImplicitField,
24
25
  type FieldSchema,
@@ -143,6 +144,42 @@ export interface SchemaStaticsAlpha {
143
144
  TCustomMetadata,
144
145
  FieldPropsAlpha<TCustomMetadata> & { defaultProvider: DefaultProvider }
145
146
  >;
147
+ /**
148
+ * Creates a field schema that is Optional in the view but behaves as Required in the stored schema
149
+ * during the rollout period of an optional-field migration.
150
+ *
151
+ * @remarks
152
+ * Use this to incrementally migrate a required field to optional without a coordinated deployment.
153
+ * The migration path is:
154
+ *
155
+ * 1. Start with `sf.required(T)` — all clients require the field.
156
+ * 2. Deploy `sf.stagedOptional(T)` — new clients can read documents where the field is present or absent, but the stored schema stays Required (so old clients are unaffected). Writing `undefined` is blocked at runtime.
157
+ * 3. Deploy `sf.optional(T)` once all clients support the staged optional field — the stored schema becomes Optional and the field can be cleared.
158
+ *
159
+ * Analogous to {@link SchemaStaticsBeta.staged} for allowed types, but for field optionality.
160
+ *
161
+ * @param t - The types allowed under the field.
162
+ * @param props - Optional properties to associate with the field.
163
+ *
164
+ * @typeParam TCustomMetadata - Custom metadata properties to associate with the field.
165
+ * See {@link FieldSchemaMetadata.custom}.
166
+ */
167
+ readonly stagedOptional: <
168
+ const T extends ImplicitAllowedTypes,
169
+ const TCustomMetadata = unknown,
170
+ >(
171
+ t: T,
172
+ props?: Omit<
173
+ FieldPropsAlpha<TCustomMetadata>,
174
+ "defaultProvider" | "stagedOptionalUpgrade"
175
+ >,
176
+ ) => FieldSchemaAlpha<
177
+ FieldKind.Optional,
178
+ T,
179
+ TCustomMetadata,
180
+ FieldPropsAlpha<TCustomMetadata>
181
+ >;
182
+
146
183
  /**
147
184
  * {@link SchemaStaticsAlpha.withDefault} except tweaked to work better for recursive types.
148
185
  * Use with {@link ValidateRecursiveSchema} for improved type safety.
@@ -225,10 +262,28 @@ const withDefault = <
225
262
  );
226
263
  };
227
264
 
265
+ const stagedOptional = <const T extends ImplicitAllowedTypes, const TCustomMetadata = unknown>(
266
+ t: T,
267
+ props?: Omit<FieldPropsAlpha<TCustomMetadata>, "defaultProvider" | "stagedOptionalUpgrade">,
268
+ ): FieldSchemaAlpha<
269
+ FieldKind.Optional,
270
+ T,
271
+ TCustomMetadata,
272
+ FieldPropsAlpha<TCustomMetadata>
273
+ > => {
274
+ return createFieldSchema(FieldKind.Optional, t, {
275
+ defaultProvider: getDefaultProvider(() => []),
276
+ ...props,
277
+ stagedOptionalUpgrade: createSchemaUpgrade(),
278
+ });
279
+ };
280
+
228
281
  const schemaStaticsAlpha: SchemaStaticsAlpha = {
229
282
  withDefault,
230
283
 
231
284
  withDefaultRecursive: withDefault as SchemaStaticsAlpha["withDefaultRecursive"],
285
+
286
+ stagedOptional,
232
287
  };
233
288
 
234
289
  /**
@@ -448,7 +503,17 @@ export class SchemaFactoryAlpha<
448
503
  public static readonly withDefaultRecursive = schemaStaticsAlpha.withDefaultRecursive;
449
504
 
450
505
  /**
451
- * Define a {@link TreeNodeSchema} for a {@link TreeMapNode}.
506
+ * {@inheritdoc SchemaStaticsAlpha.stagedOptional}
507
+ */
508
+ public readonly stagedOptional = schemaStaticsAlpha.stagedOptional;
509
+
510
+ /**
511
+ * {@inheritdoc SchemaStaticsAlpha.stagedOptional}
512
+ */
513
+ public static readonly stagedOptional = schemaStaticsAlpha.stagedOptional;
514
+
515
+ /**
516
+ * Define a {@link TreeNodeSchema} for a {@link TreeMapNodeAlpha}.
452
517
  *
453
518
  * @param name - Unique identifier for this schema within this factory's scope.
454
519
  * @param allowedTypes - The types that may appear as values in the map.
@@ -39,7 +39,7 @@ import { treeNodeApi } from "./treeNodeApi.js";
39
39
  * @remarks
40
40
  * This supports values which have value semantics and are compared by value, just like {@link TreeLeafValue}.
41
41
  * This allows using any tree value as a key (for example in an index tracking where those values occur in the tree).
42
- * @alpha
42
+ * @beta
43
43
  */
44
44
  export type TreeIndexKey = TreeLeafValue;
45
45
 
@@ -52,7 +52,7 @@ export type TreeIndexKey = TreeLeafValue;
52
52
  * @param getValue - given at least one {@link TreeNode}, returns an associated value
53
53
  * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
54
54
  *
55
- * @alpha
55
+ * @beta
56
56
  */
57
57
  export function createTreeIndex<
58
58
  TFieldSchema extends ImplicitFieldSchema,
@@ -75,7 +75,7 @@ export function createTreeIndex<
75
75
  * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
76
76
  * @param indexableSchema - a list of all the schema types that can be indexed
77
77
  *
78
- * @alpha
78
+ * @beta
79
79
  */
80
80
  export function createTreeIndex<
81
81
  TFieldSchema extends ImplicitFieldSchema,
@@ -99,7 +99,7 @@ export function createTreeIndex<
99
99
  * @param getValue - given at least one {@link TreeNode}, returns an associated value
100
100
  * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
101
101
  *
102
- * @alpha
102
+ * @beta
103
103
  */
104
104
  export function createTreeIndex<
105
105
  TFieldSchema extends ImplicitFieldSchema,
@@ -122,7 +122,7 @@ export function createTreeIndex<
122
122
  * @param isKeyValid - function for verifying the validity of the key retrieved based on the information given by the indexer
123
123
  * @param indexableSchema - a list of all the schema types that can be indexed
124
124
  *
125
- * @alpha
125
+ * @beta
126
126
  */
127
127
  export function createTreeIndex<
128
128
  TFieldSchema extends ImplicitFieldSchema,
@@ -140,7 +140,7 @@ export function createTreeIndex<
140
140
  /**
141
141
  * Creates a {@link TreeIndex} with a specified indexer.
142
142
  *
143
- * @alpha
143
+ * @beta
144
144
  */
145
145
  export function createTreeIndex<
146
146
  TFieldSchema extends ImplicitFieldSchema,
@@ -53,7 +53,10 @@ export function extractPersistedSchema(
53
53
  minVersionForCollab: MinimumVersionForCollab,
54
54
  includeStaged: (upgrade: SchemaUpgrade) => boolean,
55
55
  ): JsonCompatible {
56
- const stored = toStoredSchema(schema, { includeStaged });
56
+ const stored = toStoredSchema(schema, {
57
+ includeStaged,
58
+ includeStagedOptional: includeStaged,
59
+ });
57
60
  const codec = schemaCodecBuilder.build({
58
61
  minVersionForCollab,
59
62
  jsonValidator: FormatValidatorNoOp,